[unixODBC-support] unixODBC2.3.1 connection to ms sql server 2008 R2

Duncan Kerr Duncan.Kerr at dealhub.com
Thu Jan 5 09:35:28 GMT 2012


Thanks Nick.  Actually I already had that switched on, and there wasn't any log getting written.  Turns out my problem was that I was linking with the MS driver shared lib instead on the libodbc.so.  Everything links ok and the SQLAllocHandle calls all work, but the SQLDriverConnect call fails with SQL_INVALID_HANDLE.

Thanks

Duncan

From: Nick Gorham [mailto:nick at lurcher.org]
Sent: 05 January 2012 01:11
To: Support for the unixODBC project
Cc: Duncan Kerr
Subject: Re: [unixODBC-support] unixODBC2.3.1 connection to ms sql server 2008 R2

On 04/01/2012 12:19, Duncan Kerr wrote:
Im having problems connecting from C++, even though I can connect via my DSN with isql.  MS sqlcmd works fine, and the driver/unixODBC seem to be installed correctly.  My code fails wioth SQL_INVALID_HANDLE returned by  SQLDriverConnect because the internal list of connections is empty (__validate_dbc( connection ) fails) . Here are details of my system and code.  Any suggestions would be greatfully accepted.

I would turn on driver manager logging and see if that shows anything interesting.

in odbcinst,ini

[ODBC]
Trace = yes
TraceFile = /tmp/sql.log

--
Nick

________________________________________________________________________
This email has been scanned for viruses by MessageLabs Email Security
________________________________________________________________________

________________________________________________________________________
This message may contain privileged and confidential information 
intended only for the use of the addressee named above. If you are not 
the intended recipient of this message you are hereby notified that any
use, dissemination, distribution or reproduction of this message is 
prohibited. If you have received this message in error please notify
the sender immediately. Any views expressed in this message are those of
the individual sender and may not necessarily reflect the views of 
the company for whom they represent.
________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.unixodbc.org/pipermail/unixodbc-support/attachments/20120105/854152a9/attachment.html>


More information about the unixODBC-support mailing list