Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL Anywhere 11 ODBC / Fedora 10 / unixODBC driver issue

265 views
Skip to first unread message

hanssmallegoor

unread,
Dec 16, 2008, 8:33:24 AM12/16/08
to
I am new to Linux but I need to set up an ODBC connection
between Java and PHP applications and SQL Anywhere 11
databases. I have installed unixODBC 2.2.12 on Fedora 10 and
at the moment I have the following settings:

/etc/odbcinst.ini:
[SQLAnywhere11]
Description = ODBC for Sybase SQL Anywhere 11
Driver = /opt/sqlanywhere11/lib32/libdbodbc11.so
Setup = /opt/sqlanywhere11/lib32/libdbodbc11.so
FileUsage = 1
DontDLClose = 1
UsageCount = 1

/home/hans/.odbc.ini:
[elecdata_usr]
Description = elecdata_usr
Driver = SQLAnywhere11
Trace = No
TraceFile =
Database = elecdata
DatabaseFile =
Servername = elecdata_server
Username =
Password =
Port = 2639
Protocol = TCP
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =
Host = localhost
Namespace =
Query Timeout = 1
Static Cursors = 0

/etc/sybase.conf:
/opt/sqlanywhere11/lib32

/etc/ld.so.conf:
include ld.so.conf.d/*.conf

Now when the database server is running I can connect to my
database in Sybase Central with a connection profile using
ODBC Datasource name: elecdata_usr so this is okay. However
when I try to connect to ODBC profile: elecdata_usr using
ANY other application that application simply vanishes,
meaning something illegal happens and I suspect the problem
lies in the Sybase driver(s). I have tried many different
settings, including mentioning the driver directly in the
ODBC profile and connecting directly to the database file
instead of to a database server but the problem persists. I
have also tried ODBC system accounts instead of user
accounts but to no avail.

Can someone please point me in the right direction of what I
might be missing or doing wrong? Thanks!

Phil Mitchell [Sybase]

unread,
Dec 17, 2008, 10:41:35 AM12/17/08
to
I'll ask for some more information and maybe somebody will pick up on
this....

First of all, what build number of SA11 are you using? When you say
"any other applicaton" can you give an example? How are you using it?
Are you on a 64-bit machine? You're using the 32-bit libraries...is it
a 64-bit application? Is the environment set up correctly for your
application?

You're using the non-threaded libdbodbc11.so, what if you try the
threaded one (libdbodbc11_r.so)? If your application is threaded, this
could certainly be the problem.

What happens if you use our ODBC driver (libdbodm) instead of using the
odbc driver directly?

Thanks,
Phil

hanssmallegoor

unread,
Dec 18, 2008, 4:32:33 AM12/18/08
to
Thank you for the advice so far.

Regarding your questions, I have installed SQL Anywhere 11
version 11.0.0.1264 and at the moment we are not developing
64 bit applications so I am using the 32 bit drivers. I have
tried using the libdbodbc11_r.so driver and Sybase Central
still lets me connect to my database, however when I use the
libdbodm11.so driver Sybase Central does not connect but
keeps "hanging". As far as the environment is set up
correctly, I suspect that is not entirely the case. The
"other" applications I mentioned are the unixODBC
DataManager and the ODBC Data Source Administrator, the
odbctest tool but mainly OpenOffice.org Base which enables
me to connect to an ODBC profile. First all those tools were
simply closing when I would select my odbc profile but now I
have gotten as far as the following error message:
[unixODBC][Driver Manager]Driver's SQLAllocHandle on
SQL_HANDLE_HENV failed. Reading through numerous messages
about this error I have added the following line to my ODBC
profile: sql_attr_unixodbc_envattr = but I have no idea what
must be set here as value. I have also tried using the
LD_LIBRARY_PATH variable but once again, no result for any
of the values I used.

Ray Ruvinskiy

unread,
Dec 18, 2008, 3:39:52 PM12/18/08
to
Hi Hans,

Just to clarify a few points. libdbodbc11.so is not the non-threaded
driver. libdbodbc11_n.so is. libdbodbc11.so is a switch which will load
either the threaded or the non-threaded driver, depending on whether
your application is threaded. Also, libdbodm11.so is not a driver. It's
our ODBC Driver Manager (equivalent to unixODBC).

I'm not sure how you generated your DSN, but it contains entries that
the SQL Anywhere driver will not recognize. Try something like the
following:

Description = elecdata_usr
Driver = SQLAnywhere11

Database = elecdata
Servername = elecdata_server
UserID = <user id>
Password = <password>
Links = tcpip{port=2639}

You can consult
http://dcx.sybase.com/index.php#http%3A%2F%2Fdcx.sybase.com%2F1100en%2Fdbadmin_en11%2Fconmean.html
for a list of valid connection parameters.

Note that unixODBC's isql app does not currently work with our driver,
so you will need to try something else.

Ray

0 new messages