>I am trying to access a Microsoft Access database throgh an ado connection. First I tried the connection string in a remote view to make sure the string was ok. I added the table using remote views and till now everything worked fine. Now i want to access the table through an ado recordset. So I copied the string over to the connection object. See Code Below :
>
>oConnection = CREATEOBJECT("adodb.Connection")
>oconnection.Open('DSN=MS Access Database;DBQ=C:\LeaveTranFile.mde;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;SystemDB=C:\SecureLog.mdw;','leavelog','leavelogadmin',1)
>oRecordSet = CREATEOBJECT('adodb.recordset')
>orecordset.Open('Select * from leavelog',oConnection,1,1,1)
>
>********************************************************************
>
>As soon as i issue the last command the systemm gives me an error :
>
>OLE IDispatch exception code 0 from Microsoft OLE DB Provider for ODBC Drivers: ODBC driver does not support the requested properties...
>
>Does anyone have an idea of what i am doing wrong?
>
>Thanks.
Franco,
ADO uses OLEDB not ODBC. If you want to use ODBC (or for any connection that has ODBC driver but not OLEDB) you could use OLEDB for ODBC - MSDASQL provider.
However Access has an Oledb driver named Microsoft.Jet.Oledb.x.x where x stand for verion. ie :
local oRecordSet, oConnection
oRecordSet = Createobject("adodb.recordset")
oConnection = Createobject("adodb.connection")
lcMDBName = 'c:\myPath\Access Database Folder\myAcces.mdb'
With oConnection
.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;"+;
"Data Source="+lcMDBName
.Open()
Endwith
With oRecordSet
.ActiveConnection = oConnection
.CursorLocation= 3
.Source = "select * from [My Access TableName]"
.Open
Endwith
Cetin