Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Connect to Access Database
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01308250
Message ID:
01308342
Views:
9
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
Previous
Reply
Map
View

Click here to load this message in the networking platform