Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Configuring ODBC Connections
Message
De
14/01/2001 18:04:34
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00462621
Message ID:
00463606
Vues:
24
Ken,

FYI, using the ODBC Data Source Administrator, you can create any ODBC connection on your pc and save it to a DSN file. If you open the DSN file, it will have all the information you need to make a "DSN-less" connection using SQLSTRINGCONNECT.

For instance, I create a DSN file for a connection to one of my DBCs.
Opening the file I see:

[ODBC]
DRIVER=Microsoft FoxPro VFP Driver (*.dbf)
UID=
Deleted=Yes
Null=Yes
Collate=Machine
BackgroundFetch=Yes
Exclusive=No
SourceType=DBC
SourceDB=K:\Data\CCS\5768TestRun\CCSBusiness.DBC

This I translate into VFP code as :
cSTr = "Description=My Connection;DRIVER=Microsoft FoxPro VFP Driver (*.dbf);"+;
"Deleted=Yes;Null=Yes;Collate=Machine;BackgroundFetch=Yes;Exclusive=No;SourceType=DBC;"+;
"SourceDB = c:\Business.DBC"

nConn = SQLSTRINGCONNECT(cStr)

Now any pc with access to c:\Business.DBC, and the Microsoft FoxPro VFP Driver installed can successfully run this code and access the dbc.

Anthony Letts
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform