[unixODBC-support] SQLConnect and odbc.ini

Thinh Nguyen tnguyen at iii.com
Mon May 2 16:57:41 BST 2005


Hi,
I have to connect to mySQL server via unixODBC, and SQLConnect() doesn't 
seem to honor the parameters set in odbc.ini.
I'm wondering:
-- why does odbc always connects to the MySQL server run on the default 
port on localhost.
-- why does it always use the database named "MySQL". Should the DSN 
name always be the name of the database we try to use then?
-- the only param it seems to care is the "Driver". How do I make it 
honor the other params as well? (To get around the problem, I have been 
using SQLDriverConnect() instead so I can pass the hostname and port I 
wanted to connect to)

Thanks a lot in advance for any help.

Thinh

This is odbc.ini content:

[ODBC Data Sources]

MySQL = MySQL ODBC 3.51 Driver DSN


[MySQL]
Driver       = /dbs/tpp/odbchome/drivers/lib/libmyodbc3.so
Description  = MySQL ODBC 3.51 Driver DSN
Server       = quality.iii.com
Port         =  1032
user         =  testapp
Password     = testapp
Database     = test
Option       = 4







More information about the unixODBC-support mailing list