Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a user DSN
Message
De
19/07/2001 04:51:05
 
 
À
19/07/2001 03:58:17
Fausto Garcia
Independent Developer
Lima, Pérou
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00532392
Message ID:
00532401
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform