Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a user DSN
Message
From
19/07/2001 04:51:05
 
 
To
19/07/2001 03:58:17
Fausto Garcia
Independent Developer
Lima, Peru
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00532392
Message ID:
00532401
Views:
22
Fausto,
You can build a connection string in your programs. This way you don't rely on DSNs on the client's machine. Here are some samples:

ADO connecting to a VFP database
oConnection = CreateObject("adodb.connection")
lcConnectionString = "Driver=Microsoft Visual Foxpro Driver; " +;
                     "UID=;"+;
                     "SourceType=DBC;"+;
                     "SourceDB=C:\Program Files\Microsoft Visual Studio\MSDN98\98VS\1033\Samples\VFP98\data\TestData.dbc"
oConnection.open(lcConnectionString)
oRecordSet = CreateObject("adodb.recordset")
oRecordSet.Open("SELECT * FROM customer", oConnection)
SQL Passthrough connecting to SQL Server
lcConnectionStr = "DRIVER={SQL Server};" +;
                  "SERVER=YourServerName"+";" +;
                  "DATABASE=northwind"+";" +;
                  "UID=sa"+";" +;
                  "PWD="
lnSql = SQLSTRINGCONNECT(lcConnectionStr)
SQLEXEC(lnSql, "SELECT * FROM Customers", "Customers")
SQL Passthrough connecting to MS Access
lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
                  "Dbq=c:\temp\northwind.mdb;" +;
                  "Uid=Admin;" +;
                  "Pwd=;"
lnAccess = SQLSTRINGCONNECT(lcConnectionStr)
SQLEXEC(lnAccess, "SELECT * FROM Customers", "Customers")
For more connection strings, check out the following link:
http://www.able-consulting.com/ADO_Conn.htm

HTH
>Hi,
>
>How can I avoid creating a user dsn manually? Is there any way to create and configure it on install time?
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform