Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection to MS Access
Message
From
02/11/2005 15:39:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01064680
Message ID:
01064718
Views:
16
Without the error info is hard to guess, but perhaps it's because the table name has special characters in the name, like spaces and such. In this case you have to enclose the table name within brackets.

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform