Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Progmatically Creating ODBC datasource
Message
De
02/07/1999 10:20:55
 
 
À
01/07/1999 23:10:14
Denis Poulin
Ari Finacial Services Inc.
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00236796
Message ID:
00236908
Vues:
23
>I have been trying to research how to progmatically create a System DSN. When the application starts for the first time I would like to check to see if an ODBC data source exists, if not, I would like to create it for the user. It doesn't make sense to go to every PC into their control panel and create a DSN for every machine the app is installed on.
You can do it with SQLConfigDataSource API call (This example is for SQL Server driver):

DECLARE Integer SQLConfigDataSource In odbccp32.dll ;
Integer, Integer, String, String
Settings="DSN=myDSN"+Chr(0)+;
"Description=myDescription"+Chr(0)+;
"Server=mySQLServer"+Chr(0)+;
"Database=mySQLDatabase"+Chr(0)

SuccFail = SQLConfigDataSource(0,1,"SQL Server",Settings)

I know there's one that lists the available DSNs, but I don't have it handy.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform