Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing a linked table

Status
Not open for further replies.

Jackie

MIS
Feb 9, 2000
148
US
What is the correct method for referencing the linked table?



Below is code that worked prior to splitting the database.
I split the database and got RunTime error 3219, "Invalid Operation".

Dim mydb As Database, Mytable As Recordset, MySnap As Recordset
Set mydb = DBEngine.Workspaces(0).Databases(0)
Set MySnap = mydb.OpenRecordset("Leave Bank Transaction Log", dbOpenSnapshot)
Set Mytable = mydb.OpenRecordset("APTRES", DB_OPEN_TABLE) ' Open table.

Program is bombing on the following line:
Set Mytable = mydb.OpenRecordset("APTRES", DB_OPEN_TABLE) ' Open table.
 
the constant DB_OPEN_TABLE won't work on linked tables.
try dbopendynaset or dbopensnapshot which should do the trick.

HTH

Ben ----------------------------------------
Ben O'Hara
----------------------------------------
 

Thanks, dbopendynaset worked great.

Next issue related to linked tables:

"Operation is not supported for this type of object".
Below is the corresponding code:

Mytable.Index = "SSN" ' Select index.

Any ideas what will work instead of the above?

-jackie
 
What are you doing with the table's index?
You can't modify a linked tables properties, you will need to create a new object that points to the linked database and modify it there.

B ----------------------------------------
Ben O'Hara
----------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top