OpenRecordset on Linked Tables--Use Index Property---Future SQL concern -
03-21-2005
, 03:17 PM
I have been trying to set a recordset = to a table and thus designate
the recordet's type as 1 (dbOpenTable).
Everytime the code executes, the recordset (rst) is = to 2
(dbOpenDynamic).
Here's some of my code (2 scenarios for Set rst = ) :
Dim dbs as Database
..
..
..
Dim rst as Recordset
..
..
..
Set dbs = CurrentDb
..
..
..
(1)
Set rst = dbs.OpenRecordset("tblInstitution",dbOpenTable)
---> Errors-out to Run-Time Error 3219 Invalid Operation
OR
(2)
Set rst = dbs.OpenRecordset("tblInstitution") sets the type to 2
(dbOpenDynaset) even though tblInstitution is a table in my database.
..
..
..
rst.Index
Run-Time Error 3251 (Object Doesn't Support Property) when the code is
written as (2)...it doesn't reach this far when I code for the
recordset as in (1).
FYI: I know that I have to set the recordset to an Table-Type in order
to get the Index Property working, but I thought I would just try it
any way with the (2) example...)
One caveat, my table in the database is a linked-table...does this have
any bearing on the situation?
(I don't see why it would, but I figured it would be better to mention
it).
Also, I plan on moving my tables out of the linked Access Db and into
SQL...will this interfer with my creation of the recordset and
reference to the recordset's Index property (defined as an Index in the
table)?
Any Help you can provide would be great.
Thanks.
---BennyD |