|
From: Robert B. <ro...@tr...> - 2011-01-25 22:11:02
|
Michał Sawicz wrote:
> Hi, I'm trying to get Python to work with a ASA 9.0.1 server and having
> not much luck...
>
> Just to confirm the server's working and such, the following in Perl
> works fine:
>
> DBI->connect('DBI:Sybase:server=asademo;database=asademo', 'DBA',
> 'SQL');
>
> First I tried python-mssql as it's supposed to work with Sybase, too,
> but I couldn't get connected to the database at all, getting "Could not
> set connection properties" errors when I was able to connect at last.
>
> I also tried tsql itself, which seemed to connect (I got a 1> prompt)
> but regardless of what query I tried to execute, I got no response,
> dropping me to another prompt (2>).
>
did you type "go" at the 2nd prompt and hit <Enter> ?
> After some googling I found out that I should be using python-sybase. I
> tried both 0.39 and 0.40pre1, yielding the same results:
>
>
>
>> ctx.c:242: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
>> ‘__attribute__’ before ‘clientmsg_cb’
>> ctx.c:287: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or
>> ‘__attribute__’ before ‘servermsg_cb’
>> ctx.c: In function ‘CS_CONTEXT_ct_callback’:
>> ctx.c:364: error: ‘clientmsg_cb’ undeclared (first use in this
>> function)
>> ctx.c:364: error: (Each undeclared identifier is reported only
>> once
>> ctx.c:364: error: for each function it appears in.)
>> ctx.c:370: error: ‘servermsg_cb’ undeclared (first use in this
>> function)
>> error: command 'gcc' failed with exit status 1
>>
>
> when built without -DHAVE_FREETDS. It built and installed fine with
> either of -DHAVE_FREETDS and -DHAVE_FREETDS=82 (I've freetds 0.82 from
> Debian lenny), but then trying to import the Sybase module results in:
>
>
>> /usr/local/lib/python2.6/dist-packages/python_sybase-0.39-py2.6-linux-i686.egg/sybasect.so: undefined symbol: cs_config
>>
>
> And now I give up :/
>
> Am I doing something wrong or do I simply have to drop that and go some
> other route?
>
> Best regards,
>
It sounds like you're not specifying the right arguments to allow these
pieces of software to connect to the server.
Normally, you need a hostname, port, username and password. How you
combine those to get a connection would depend on the specific software
you're using.
Post the details of how you create the connection - better yet - try and
connect with explicit arguments, after you make sure you know what to
set where.
HTH,
Robert
|