
Recordset Object Error with Linked Table
Hi,
I need help on the following :
When I used this code :
Dim dbCurrent As Database
Dim tdBill As Tabledef
Dim rsBill As Recordset
Dim stBillNo As string
.
.
Set dbcurrent = CurrentDB()
Set tdBill = dbCurrent.Tabledefs("Bills")
set rsBill = tdBill.OpenRecordset (dbOpentable)
rsBill.index = "PrimaryKey"
.
.
rsBill.Seek "=", stBillNo
.
This works fine if I have a non-linked table. And I like to use "Seek"
as I think it is fast to get the record I want.
Now, when I use database splitter to split the database into two
databases with data and applications on seperate database. The above
code gave me run-time error "Invalid Operation" And after reading the
Access Help File, I found that Access will not let you use Table-Type
recordset with linked tables.
This mean that I have to change the recordset "rsBill" to other type
(dynaset or snapshot) and this means I cannot use seek. When I use
Dynaset type, and use the command
rsBill.Findfirst "BillNo Like '" & stBillNo & "'"
Access took more time to return me the record
I'm sure there must be a way to implement alternative codes which is
faster (but I'm just don't know yet). Can you help me find a way to
solve this problem?
Thanks
Ruecha