Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC Data Sources
Message
De
01/06/1999 14:24:02
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00224119
Message ID:
00225046
Vues:
23
>Bob;
>
>Here's the code I promised:
>
>* Testing creation of SQL Data Source
>* See VFP Documentation on SQLConnetc, SQLExec and SQLDisConnect
>*
>declare integer SQLConfigDataSource in odbccp32 Integer, Integer, String, String
>settings="DSN=Employees"+chr(0)+"Description=Temporary Employee Data"+chr(0)+"FileType=Microsoft Access Driver (*.mdb)"+chr(0)+"DBQ=F:\projects\accountg\data\printing\infortext.mdb"+chr(0)+"MaxScanRows=16"
>= SQLConfigDataSource(0,1,"Microsoft Access Driver (*.mdb)",settings)
>* SQL Data Settings are created
>STORE SQLConnect('Employees') TO gnConnHandle
>IF gnConnHandle<=0
> =MessageBox('Cannot Make Connection', 16, 'SQL Connect Error')
>ENDIF
>= SQLSETPROP(gnConnHandle, 'asynchronous', .F.)
>WAIT WINDOW "Ready to Connect..."
>= SQLEXEC(gnConnHandle, 'SELECT * FROM VALUSER Valuser', 'UserTemp')
>*
>* This is where you do your work with the tables. Here, I'm simply
>* querying to a cursor for later use:
>*!* SELECT _ssn_ AS Soc_Sec, LEFT(_Name_,35) AS Full_Name ;
>*!* FROM UserTemp ;
>*!* WHERE UserTemp._ssn_ NOT IN ;
>*!* (SELECT Soc_Sec FROM Users);
>*!* INTO CURSOR IntUsers
>
>*Disconnect from Data Source:
>=SQLDisConnect(gnConnHandle)
>* And remove settings:
>IsRemove =SQLConfigDataSource(1,3,"Microsoft Access Driver (*.mdb)",settings)
>* SQL Data Settings are removed


Great clues! I think I'm back under control again. Thanks for the push.

Bob
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform