Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC - SQLConfigDataSource
Message
From
17/06/1999 13:02:25
 
 
To
17/06/1999 12:02:26
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00230937
Message ID:
00230957
Views:
25
>Rather than going to each of my users’ machines, and building multiple ODBC DSN connections by hand for my Btrieve ODBC driver, I have been trying to use lnHandle = SQLConfigDataSource(0,1, "Pervasive Software ODBC-32", lcMySettings) as described in the Microsoft article Q142216.
>
>This returns a positive numeric value (success). In my next step though … SQLExec(lnHandle, lcMySQLCode, "MyCursor") gives me error 1466 – Connection handle is invalid.
>
>However; if I first create a remote view in the data environment of a different form, that uses one of my hand built ODBC data source names (I did build some), then I run the above code in it’s own separate form, it works! If I then close the connection with SQLDisconnect(lnHandle) and rerun lnHandle = SQLConfigDataSource(0,1, "Pervasive Software ODBC-32", lcMySettings) (which again returns a positive value) then I run SQLExec(lnHandle, lcMySQLCode, "MyCursor") it gives me the error 1466 error again.
>
>I’m missing some sort of concept here. Can anybody see the missing (or extra) step.

I've found the problem. I was assuming that SQLConfigDataSource() was returning a file handle. It wasn't. The command following SQLConfigDataSource() should have been SQLConnect(lcTheDSNNameThatIPassedToSQLConfigDataSource)

With SQLConnect() done, the following SQLExec() works fine now.

Bob
Previous
Reply
Map
View

Click here to load this message in the networking platform