Important...
I need to use a seek metod on a linked table in \\myserver\mydir\MYDATABASE.Mdb
Tks.
SEEK on a linked table with DAO or ADO
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 78628
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SEEK on a linked table with DAO or ADO
I don't think you can use Seek with a linked table.
You'll have to open a recordset on the source table, not on the linked table.
You'll have to open a recordset on the source table, not on the linked table.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
Re: SEEK on a linked table with DAO or ADO
Wath you think about:HansV wrote:I don't think you can use Seek with a linked table.
You'll have to open a recordset on the source table, not on the linked table.
Code: Select all
Public Sub Open_For_Seek()
stDbName = "\\rom\work$\FS07\GO\DATABASE\TUTTI.MDB"
Set dbCur = Workspaces(0).OpenDatabase(stDbName)
Set RST = DBEngine(0)(0)("TUTTI").OpenRecordset
RST.Index = "RAPP"
End Sub
-
- Administrator
- Posts: 78628
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SEEK on a linked table with DAO or ADO
Is \\rom\work$\FS07\GO\DATABASE\TUTTI.MDB the backend database that contains the actual table?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
Re: SEEK on a linked table with DAO or ADO
yesHansV wrote:Is \\rom\work$\FS07\GO\DATABASE\TUTTI.MDB the backend database that contains the actual table?
TUTTI table
Note
Database and table have the same name, is a simple case:-)
-
- Administrator
- Posts: 78628
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SEEK on a linked table with DAO or ADO
It should work if the table has an index named RAPP.
Otherwise, you can use the FindFirst method of the recordset. This will work with non-indexed fields too.
Otherwise, you can use the FindFirst method of the recordset. This will work with non-indexed fields too.
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4370
- Joined: 26 Apr 2010, 17:36
Re: SEEK on a linked table with DAO or ADO
but in term of time to find a value, is good seek or findfirst?HansV wrote:It should work if the table has an index named RAPP.
Otherwise, you can use the FindFirst method of the recordset. This will work with non-indexed fields too.
in other case if findfirst is false i need to check .Eof or ?
note:
in RAPP dont is possible duplicte values
-
- Administrator
- Posts: 78628
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: SEEK on a linked table with DAO or ADO
If you have an existing index on RAPP, you can use Seek.
In all situations, you can use FindFirst.
If Seek or FindFirst doesn't find a match, RST.NoMatch will be true.
In all situations, you can use FindFirst.
If Seek or FindFirst doesn't find a match, RST.NoMatch will be true.
Best wishes,
Hans
Hans