Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating SQL Server Connection without DSN defined
Message
 
 
To
08/02/2000 17:10:26
Menachem Turchick
Pima County Superior Court
Tucson, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00329192
Message ID:
00329359
Views:
16
>Using Visual Fox Pro.
>
>I am trying to connect to a SQL Server without using a DSN
>that is already defined. I was able to do this in Microsoft Visual
>Basic by creating a connection string and using an RDO object.
>
>In Visual Basic it looks like this
>
>sDSN = "uid= " & Login & ";pwd=" & Password & ";Server=" & Server) _
> ";driver={SQL Server};database=" & DBase & ";DSN='';"APP=AppName"
>
>I pass in Login, Password, Server, and DBase.
>
>Then using an rdoConnection I can connect to my SQL server. This prevents me from having to setup a DSN on all the users computers.
>
>
>Thanks for your help

Menachem,

You can create DSNless connection TO SQL Server using code beloW:
SQLSTRINGCONNECT("DRIVER={SQL Server}; Server=Myserver; UID=Myid; PWD=mypassword; DATABASE=mydatabase;"
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform