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

VB6 + ODBC32.DLL

120 views
Skip to first unread message

Gilles Ratel

unread,
Mar 30, 2003, 8:08:46 PM3/30/03
to

I would use ODBC driver directly, but I have problem with use of SQLconnect.

Declare Function SQLConnect Lib "odbc32.dll" (ByVal hdbc As Long, ByVal
szDSN As String, ByVal cbDSN As Integer, ByVal szUID As String, ByVal
cbUID As Integer, ByVal szAuthStr As String, ByVal cbAuthStr As Integer) As
Integer


retcode = SQLAllocEnv(henv) ' OK
retcode = SQLAllocConnect(henv, hdbc) 'OK

sDSN = "Driver={Microsoft Access Driver
(*.mdb)};DATABASE=C:\myDatabase.mdb"
sDSN = "DATABASE=C:\myDatabase.mdb"
sUID = "sa" 'user ID
sPWD = "" 'password
retcode = SQLConnect(hdbc, sDSN, Len(sDSN), sUID, Len(sUID), sPWD,
Len(sPWD)) ' retcode=-1 ???
retcode = SQLDisconnect(hdbc)

retcode = SQLFreeConnect(hdbc) 'OK
retcode = SQLFreeEnv(henv) 'OK

I think my problem is string "sDSN" .... ?

Do you have hint? Thanks


Stefano Boscolo

unread,
Jun 24, 2003, 8:41:37 AM6/24/03
to
Dear Gilles

I don't try to give you an answer. Years ago I tried to use odbc32.dll with
no driver. I started from the work: "Ramosoft de Mexico S.A. of C.V.
http://www.ramosoft.com/
Author: Leontti A. Ramos M. mailto:leo...@leontti.net".
I tried to find some example of this technique but with no effort. Can you
suggest me something? I mean examples and so on.

Your

Stefano Boscolo

0 new messages