Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Connect to Access Database
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01308250
Message ID:
01308342
Vues:
8
Thanks. I will give it a try!

>>Hello,
>>
>>How do you connect to a Microsoft Access database from within VFP8/SP1 ?
>>
>>Once connected, I want to query one of the Microsoft Access tables on a social security number and store the matching record in a temporary VFP table.
>>
>>Thanks for your assistance.
>Hi Terry
>
constring = "DBQ=f:\...\yourname.mdb;Driver={Driver do Microsoft Access (*.mdb)};DriverId=25;FIL=MS Access;MaxBufferSize=2048;MaxScanRows=8"
>
>sqlHandler = SQLSTRINGCONNECT(constring)
>IF sqlhandler < 1
>   AERROR(arrError)
>   MESSAGEBOX(arrError(1,2))
>   RETURN
>ENDIF
>
>TEXT TO sqlSelect NOSHOW ...
>     SELECT ...  FROM accesstable ... WHERE...
>ENDTEXT
>
>IF SQLEXEC(sqlHandler,sqlselect,"MyCursor") <0
>   AERROR(arrError)
>   MESSAGEBOX(arrError(1,2))
>   RETURN
>ENDIF
>BROWSE NORMAL
>
>The data from Access database are in MyCursor.
Thanks,

TFISHER
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform