Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding a DSN by VFP
Message
 
À
25/04/2005 18:59:56
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01008278
Message ID:
01008280
Vues:
20
The following is a fragment from code sample

Adding an ODBC data source with the SQLConfigDataSource; use automatic or interactive mode
http://www.news2news.com/vfp/?example=381&function=584
#DEFINE ODBC_ADD_DSN 1

* accessign VFP free tables in a directory
cDriver = "Microsoft Visual FoxPro Driver"
cAttributes =;
	"DSN=NewVFP2" + Chr(0) +;
	"Description=Sample VFP Data Source" + Chr(0) +;
	"SourceDB=C:\data\vfp\payroll" + Chr(0) +;
	"SourceType=DBF" + Chr(0) +;
	"Collate=Machine" + Chr(0) +;
	"BackgroundFetch=Yes" + Chr(0) +;
	"Exclusive=No" + Chr(0)

hWindow = GetActiveWindow()

IF SQLConfigDataSource(hWindow,;
	ODBC_ADD_DSN, cDriver, cAttributes) = 0
	= MessageBox("Error!", 48, " Error")
ENDIF
Hope it helps.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform