[unixODBC-support] unixODBC Setup on Gentoo

Spencer Ogden spencer at spencerogden.com
Wed Aug 29 23:35:54 BST 2012


Am am doing some initial setup to test unixODBC to make sure I have my 
setup correct. My eventual goal is to use unixODBC to and the MS SQL For 
Linux Driver to connect AD authenticated users to SQL Server. For now, 
I'm starting with the basics:

I am trying to setup a DSN for an SQLite db, and connect using isql to 
verify my config. I have installed the SQLite_odbc driver, as well as 
unixODBC 3.52.  Sorry for the very long email, but I wanted to capture 
all of the relevant details of my setup. Thanks for any help or advice, 
it is greatly appreciated.

Spencer

# odbc_config --longodbcversion
3.52
# odbc_config --odbcini
/etc/unixODBC/odbc.ini
# odbc_config --odbcinstini
/etc/unixODBC/odbcinst.ini

Here is odbcinst.ini, the lib locations for the driver are definitely 
correct and checks out find with ldd
  # cat /etc/unixODBC/odbcinst.ini
[SQLite]
     Description=SQLite ODBC Driver
     Driver=/usr/lib64/libsqlite3odbc.so
     Setup=/usr/lib64/libsqlite3odbc.so
     Threading=2

[ODBC]
Trace = Yes
TraceFile = /tmp/odbc.spencer.log

Here is odbc.ini
  # cat /etc/unixODBC/odbc.ini
[Test]
         Description = Test database
         Driver = SQLite
         Database = /root/test.sqlite

# odbcinst -q -s
[Test]

The test database is setup and working:
  # sqlite3 /root/test.sqlite "SELECT * FROM testtbl"
test good

When I try isql, I get an error:
  # isql Test -v
[IM002][unixODBC][Driver Manager]Data source name not found, and no 
default driver specified
[ISQL]ERROR: Could not SQLConnect

Since Tracing is on, the contents of that are shown below:
  # cat /tmp/odbc.spencer.log
[ODBC][19331][1346278438.061463][__handles.c][460]
                 Exit:[SQL_SUCCESS]
                         Environment = 0x60c780
[ODBC][19331][1346278438.061577][SQLAllocHandle.c][375]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x60c780
[ODBC][19331][1346278438.061629][SQLAllocHandle.c][493]
                 Exit:[SQL_SUCCESS]
                         Output Handle = 0x60d080
[ODBC][19331][1346278438.061681][SQLConnect.c][3700]
                 Entry:
                         Connection = 0x60d080
                         Server Name = [Test][length = 4 (SQL_NTS)]
                         User Name = [NULL]
                         Authentication = [NULL]
[ODBC][19331][1346278438.062822][SQLConnect.c][3908]Error: IM002
[ODBC][19331][1346278438.062892][SQLError.c][434]
                 Entry:
                         Connection = 0x60d080
                         SQLState = 0x7fff8bebcdc0
                         Native = 0x7fff8bebcdd8
                         Message Text = 0x7fff8bebcbc0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fff8bebcdde
[ODBC][19331][1346278438.062954][SQLError.c][471]
                 Exit:[SQL_SUCCESS]
                         SQLState = IM002
                         Native = 0x7fff8bebcdd8 -> 0
                         Message Text = [[unixODBC][Driver Manager]Data 
source name not found, and no default driver specified]
[ODBC][19331][1346278438.063119][SQLError.c][434]
                 Entry:
                         Connection = 0x60d080
                         SQLState = 0x7fff8bebcdc0
                         Native = 0x7fff8bebcdd8
                         Message Text = 0x7fff8bebcbc0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fff8bebcdde
[ODBC][19331][1346278438.063156][SQLError.c][471]
                 Exit:[SQL_NO_DATA]
[ODBC][19331][1346278438.063195][SQLError.c][514]
                 Entry:
                         Environment = 0x60c780
                         SQLState = 0x7fff8bebcdc0
                         Native = 0x7fff8bebcdd8
                         Message Text = 0x7fff8bebcbc0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fff8bebcdde
[ODBC][19331][1346278438.063232][SQLError.c][551]
                 Exit:[SQL_NO_DATA]
[ODBC][19331][1346278438.063331][SQLFreeHandle.c][284]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x60d080
[ODBC][19331][1346278438.063378][SQLFreeHandle.c][333]
                 Exit:[SQL_SUCCESS]
[ODBC][19331][1346278438.063417][SQLFreeHandle.c][219]
                 Entry:
                         Handle Type = 1
                         Input Handle = 0x60c780
[ODBC][19340][1346278708.837567][__handles.c][460]
                 Exit:[SQL_SUCCESS]
                         Environment = 0x60c780
[ODBC][19340][1346278708.837688][SQLAllocHandle.c][375]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x60c780
[ODBC][19340][1346278708.837741][SQLAllocHandle.c][493]
                 Exit:[SQL_SUCCESS]
                         Output Handle = 0x60d080
[ODBC][19340][1346278708.837793][SQLConnect.c][3700]
                 Entry:
                         Connection = 0x60d080
                         Server Name = [Test][length = 4 (SQL_NTS)]
                         User Name = [NULL]
                         Authentication = [NULL]
[ODBC][19340][1346278708.839126][SQLConnect.c][3908]Error: IM002
[ODBC][19340][1346278708.839214][SQLError.c][434]
                 Entry:
                         Connection = 0x60d080
                         SQLState = 0x7fff41e05be0
                         Native = 0x7fff41e05bf8
                         Message Text = 0x7fff41e059e0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fff41e05bfe
[ODBC][19340][1346278708.839276][SQLError.c][471]
                 Exit:[SQL_SUCCESS]
                         SQLState = IM002
                         Native = 0x7fff41e05bf8 -> 0
                         Message Text = [[unixODBC][Driver Manager]Data 
source name not found, and no default driver specified]
[ODBC][19340][1346278708.839444][SQLError.c][434]
                 Entry:
                         Connection = 0x60d080
                         SQLState = 0x7fff41e05be0
                         Native = 0x7fff41e05bf8
                         Message Text = 0x7fff41e059e0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fff41e05bfe
[ODBC][19340][1346278708.839481][SQLError.c][471]
                 Exit:[SQL_NO_DATA]
[ODBC][19340][1346278708.839520][SQLError.c][514]
                 Entry:
                         Environment = 0x60c780
                         SQLState = 0x7fff41e05be0
                         Native = 0x7fff41e05bf8
                         Message Text = 0x7fff41e059e0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fff41e05bfe
[ODBC][19340][1346278708.839556][SQLError.c][551]
                 Exit:[SQL_NO_DATA]
[ODBC][19340][1346278708.839655][SQLFreeHandle.c][284]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x60d080
[ODBC][19340][1346278708.839703][SQLFreeHandle.c][333]
                 Exit:[SQL_SUCCESS]
[ODBC][19340][1346278708.839741][SQLFreeHandle.c][219]
                 Entry:
                         Handle Type = 1
                         Input Handle = 0x60c780
[ODBC][19384][1346279417.344336][__handles.c][460]
                 Exit:[SQL_SUCCESS]
                         Environment = 0x60c780
[ODBC][19384][1346279417.344440][SQLAllocHandle.c][375]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x60c780
[ODBC][19384][1346279417.344494][SQLAllocHandle.c][493]
                 Exit:[SQL_SUCCESS]
                         Output Handle = 0x60d080
[ODBC][19384][1346279417.344581][SQLConnect.c][3700]
                 Entry:
                         Connection = 0x60d080
                         Server Name = [Test][length = 4 (SQL_NTS)]
                         User Name = [NULL]
                         Authentication = [NULL]
[ODBC][19384][1346279417.345924][SQLConnect.c][3908]Error: IM002
[ODBC][19384][1346279417.346014][SQLError.c][434]
                 Entry:
                         Connection = 0x60d080
                         SQLState = 0x7fffa9cab1d0
                         Native = 0x7fffa9cab1e8
                         Message Text = 0x7fffa9caafd0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fffa9cab1ee
[ODBC][19384][1346279417.346091][SQLError.c][471]
                 Exit:[SQL_SUCCESS]
                         SQLState = IM002
                         Native = 0x7fffa9cab1e8 -> 0
                         Message Text = [[unixODBC][Driver Manager]Data 
source name not found, and no default driver specified]
[ODBC][19384][1346279417.346306][SQLError.c][434]
                 Entry:
                         Connection = 0x60d080
                         SQLState = 0x7fffa9cab1d0
                         Native = 0x7fffa9cab1e8
                         Message Text = 0x7fffa9caafd0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fffa9cab1ee
[ODBC][19384][1346279417.346346][SQLError.c][471]
                 Exit:[SQL_NO_DATA]
[ODBC][19384][1346279417.346387][SQLError.c][514]
                 Entry:
                         Environment = 0x60c780
                         SQLState = 0x7fffa9cab1d0
                         Native = 0x7fffa9cab1e8
                         Message Text = 0x7fffa9caafd0
                         Buffer Length = 500
                         Text Len Ptr = 0x7fffa9cab1ee
[ODBC][19384][1346279417.346425][SQLError.c][551]
                 Exit:[SQL_NO_DATA]
[ODBC][19384][1346279417.346532][SQLFreeHandle.c][284]
                 Entry:
                         Handle Type = 2
                         Input Handle = 0x60d080
[ODBC][19384][1346279417.346583][SQLFreeHandle.c][333]
                 Exit:[SQL_SUCCESS]
[ODBC][19384][1346279417.346625][SQLFreeHandle.c][219]
                 Entry:
                         Handle Type = 1
                         Input Handle = 0x60c780


Thanks,

Spencer








More information about the unixODBC-support mailing list