Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection to MS Access
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Connection to MS Access
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064680
Message ID:
01064680
Views:
75
Hi All,

I am attempting to connect to an Access database.

I use lnConnHandle=sqlstringconnect('DSN=MS Access Database;DBQ='+;
lcMDBDir+'\'+lcMDBName+';DefaultDir='+;
lcMDBDir+';DriverId=25;FIL=MS Access;MaxBufferSize=2048;'+;
'PageTimeout=5;UID=admin;')

after setting the lc variables to their proper values and make a successful connection.

I follow this with...

sqltables(lnConnHandle,['TABLE'], 'curMDB')

...to retrieve a cursor that contains the names of the tables within the Database.

In this instance there is only one table, therefore, one record in curMDB.

I then build the following variables:

lcSQL='select * from '+trim(table_name)
lcCursor='curAccTbl'

I then issue...

nresult=sqlexec(lnConnHandle,lcSQL,lcCursor)

...in order to get to the actual table, but it fails, returning a value of -1 in nresult.

What have I missed?

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform