OpenRecordset as dbOpenTable, Use Index Property, SQL question for Future - 03-21-2005 , 02:29 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
Here's some of my code (2 scenarios for Set rst = ) :
Dim dbs as Database
Dim rst as Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblInstitution",dbOpenTable)
---> Errors-out to Run-Time Error 3219 Invalid Operation
Set rst = dbs.OpenRecordset("tblInstitution") sets the type to 2
(dbOpenDynaset) even though tblInstitution is a table in my database.
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
Also, I plan on moving my tables, their keys, and Indexes out of the
linked Access Db and into SQL...will this interfere with my rst =
statement and will I be able to reference the Index property?
Any Help you can provide would be great.