General information
Category:
Coding, syntax & commands
Title:
Connection to MS Access
Environment versions
Network:
Windows 2003 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only