Linked tables and Indexes problem (1 Viewer)

DMC

Registered User.
Local time
Today, 09:58
Joined
Dec 6, 1999
Messages
23
Does anyone know how to reference the indexes in a linked table. For example when using the seek method, I keep getting err 3251 which is effectively telling me I can't reference the indexes of recordsets which are linked tables. Any help would be appreciated.
 

MHM

Registered User.
Local time
Today, 09:58
Joined
Mar 15, 2000
Messages
101
This is not so easy...

You can't access linked tables with "Seek". So you need to open the database containing the real table:

set dbCurr=currentDB
varDbConnectFileName = dbCurr.TableDefs("LinkedTableName").Connect
varDbConnectFileName = Mid$(varDbConnectFileName, InStr(varDbConnectFileName, "DATABASE=") + 9)
Set dbConnect = Workspaces(0).OpenDatabase(varDbConnectFileName)

Now you can open a table directly in dbConnect like:

set rsToSeek=dbConnect.OpenRecordset("TableName",dbOpenTable)
rsToSeek.Seek SeekString

Don't give up when struggling - it works!
 

belton

Registered User.
Local time
Today, 09:58
Joined
May 9, 2001
Messages
13
What exactly is it that makes the linked table unaccessible for these type of functions? It works great for queries.
 

Users who are viewing this thread

Top Bottom