Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating SQL Server Connection without DSN defined
Message
From
09/02/2000 09:02:54
 
 
To
08/02/2000 18:03:09
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00329192
Message ID:
00329368
Views:
20
>I was afraid you'd say that :)

>I wasn't sure, so I thought I'd throw that out there. I will poke around, and >see what I come up with.

>Best,
>Bill

Does this help,

*!* Create string
lcOdbc = 'AnsiNPW=No' + CHR(0) +;
'DSN=dsnnameyouwant' + CHR(0) +;
'Database=databasename' + CHR(0) +;
'Description= Connection to SQL backend' + CHR(0) +;
'OemToAnsi=No' + CHR(0) + ;
'Quotedid=Yes' + CHR(0) + ;
'Server=servername'

DECLARE Integer SQLConfigDataSource IN odbccp32.dll Integer, Integer, String, String

=SQLConfigDataSource( 0, 3, "SQL Server", lcOdbc ) && delete a DSN if it already exists

=SQLConfigDataSource( 0, 1, "SQL Server", lcOdbc ) && recreate the DSN

lnHandleName=SQLCONNECT( "dsnnameyouwant", "username", "password")

Cheers
Steve Lea
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform