On Tue, 16 Sep 2003 22:05:46 GMT in comp.databases.ms-access, "Paul
Copeland" <pa***@ngbrown.com.au> wrote:
Hi,
I am using Access2000 and have developed a data base which successfully uses
DAO code in some of the forms to update tables.
Recently I converted the data base to a split MDE data base and now get
errors in the DAO methods.
IE:
Dim Rst As DAO.Recordset
Set Rst = CurrentDb.OpenRecordset("TableName")
Rst.Index = "IndexName"
The code halts at the last line above with the error message "Operation not
supported by this type of object"
Should the DAO code work on an MDE data base or should I be using ADO code.
ADO would not support that even on the local tables. The DAO method
you're using only works for tables in the database that you're working
in, not attached tables, you need to open the backend database first,
e.g.
Dim db As database, rs as recordset
set db = dbengine(0).opendatabase("c:\foo\bar\mydata.mdb")
set rs=db.openrecordset("TableName")
rs.index="IndexName"
....
rs.close
set rs=nothing
db.close
set db=nothing
Remember this is a database object you will have to close since you
opened it.
--
A)bort, R)etry, I)nfluence with large hammer.
(replace sithlord with trevor for email)