SQLDriverConnect and ODBC Driver Manager 
Author Message
 SQLDriverConnect and ODBC Driver Manager

Hi all,

I wrote an ODBC driver which supports ODBC Level1 functions. When I
call SQLDriverConnect() from an application (or from ODBC Test utility)
the driver manager(DM) reports that the driver does not support that
function. SQLConnect works fine.

In the registry entry, the driver installer sets APILevel to 1 and
ConnectFunctions to YYN. The DM calls SQLGetInfo() to get the
SQL_DRIVER_ODBC_VERSION, for which the driver returns 02.10.

How does the DM determine if a driver supports a function?

Are there any ODBC experts out there who can shed some light on this?

Lee

--

Convergent Group Asia Pacific \  /    Phone: +61 2 9239 4610
Level 8, 55 Sussex St.        /  \ Internal:  36 4610
Sydney 2000, Australia       /    \     Fax: +61 2 9290 1123



Sun, 16 May 1999 03:00:00 GMT  
 SQLDriverConnect and ODBC Driver Manager

Lee,

An application can determine whether a driver supports a specific ODBC API
using the API SQLGetFunction. This function in turn can be implemented by
the driver but in many cases the driver defers to the default
implementation provided by the driver manager.
The DM can implements this function by checking to see which of the ODBC
API functions have been exported by the driver DLL.
In your case I would check that your SQLDriverConnect is either declared
with the _export keyword (or equivalent) or included in the EXPORTS section
of the DLL's .DEF file [is this a 16-bit driver? As you've mentioned ODBC
2.10 I assuming it is]

Hope this helps

Paul



Mon, 17 May 1999 03:00:00 GMT  
 SQLDriverConnect and ODBC Driver Manager

Quote:

> Lee,

> An application can determine whether a driver supports a specific ODBC API
> using the API SQLGetFunction. This function in turn can be implemented by
> the driver but in many cases the driver defers to the default
> implementation provided by the driver manager.
> The DM can implements this function by checking to see which of the ODBC
> API functions have been exported by the driver DLL.
> In your case I would check that your SQLDriverConnect is either declared
> with the _export keyword (or equivalent) or included in the EXPORTS section
> of the DLL's .DEF file [is this a 16-bit driver? As you've mentioned ODBC
> 2.10 I assuming it is]

> Hope this helps

> Paul

Paul (and others)

I exported SQLDriverConnect in the driver DLL by ordinal. But when
looking
up the ordinal of SQLDriverConnect I found 29 and used it without
realising
its a hex number. Should have used its decimal equivalent (41) instead.
That's why the DM couldn't find it.

Thanks for your responses.

Lee
--

Convergent Group Asia Pacific \  /    Phone: +61 2 9239 4610
Level 8, 55 Sussex St.        /  \ Internal:  36 4610
Sydney 2000, Australia       /    \     Fax: +61 2 9290 1123



Sat, 22 May 1999 03:00:00 GMT  
 SQLDriverConnect and ODBC Driver Manager

What do you return for SQLGetFunctions?



Quote:

> How does the DM determine if a driver supports a function?



Tue, 25 May 1999 03:00:00 GMT  
 SQLDriverConnect and ODBC Driver Manager

Hello Ken,

A driver doesn't have to support SQLGetFunctions at all. The DM appears to
attempt to get proc addresses for each API, and if it gets a proc address
it considers the function supported.

Dale Hunscher
South Wind Design, Inc.



Quote:
> What do you return for SQLGetFunctions?



> > How does the DM determine if a driver supports a function?



Tue, 25 May 1999 03:00:00 GMT  
 SQLDriverConnect and ODBC Driver Manager

Dale,

You'e absolutely right! And when the driver exports the stub function
LoadByOrdinal the DM will do this by ordinal. This is presumably how Lee's
problem arose. He exported the SQLDriverConnect function with the decimal
equivalent of the correct ordinal (ie 29 instead of 41, if you get the
drift!) .

Regards

Paul



Tue, 25 May 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. [ODBC Driver Manager] Driver's SQLSetConnectAttr failed

2. [ODBC Driver Manager] Data source name not found and no default driver specified

3. not allowing ODBC Driver Manager to appear

4. Oracle ODBC driver / Microsoft ODBC driver for Oracle

5. [ODC Driver Manager] Data source name not found and no default driver specified

6. Q: SQLDriverConnect (ODBC), VB4 &NT3.51

7. Q: SQLDriverConnect (ODBC), VB4 &NT3.51

8. * Microsoft Text Driver as an ODBC driver

9. ODBC-connection to BASIS ODBC Driver

10. [ODBC Microsoft Access Driver] ODBC--call failed.

11. [ODBC Microsoft Access Driver] ODBC--call failed.

12. ms obdc driver manager not found

 

 
Powered by phpBB® Forum Software