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

Using SQLDriverConnect() to create connection string...

4 views
Skip to first unread message

slakr

unread,
Oct 24, 2005, 11:30:13 PM10/24/05
to
I am trying to dynamically create an ODBC connection string. I have
been able to use SQLDrivers() to retrieve the list of installed
drivers, and SQLDriverConnect() seems to be the next step according to
what I understand from the MSDN docs.

>From what I have read, if I make the call

SQLDriverConnect(
hDbc,
hWnd,
"ODBC;DRIVER={such and such}",
SQL_NTS,
buffer,
bufferLen,
&actualLen,
SQL_DRIVER_PROMPT);

the ODBC driver manager should bring up the driver's configuration
window and the resulting connection string will be passed to 'buffer'.
When I do this, however, I only get the ODBC "Select Data Source"
dialog. This is not very helpful considering I do not want to create a
named DSN.

I have looked through the ODBC API docs and cannot find a function that
talks directly to the driver instead of going through the driver
manager, so I assume this is the only way to accomplish what I need.

If anyone has an ideas or can point me in the right direction, the help
would be appreciated.

0 new messages