Using Seek on Linked table...

Posted on 2007-08-06
Last Modified: 2013-11-05
Access 2003

I'am trying to open a database and then open a recordset that is the linked table....

I'am using the seek method...

I don't think I have my references set correctly....
Do I need a specifc reference for this  ..

' for Linked Table XrefInfo   08/06/2007
Dim dbBE As Database
Dim strBEPath As String
strBEPath = Mid(CurrentDb.TableDefs( _
"tblXrefInfo").Connect, 11)
Set dbBE = OpenDatabse(strBEPath)
' ================================================
Set qd = CurrentDb.QueryDefs("qryBruteForceResultMfrnum")
Set dbs = CurrentDb
Set rsCust = CurrentDb.OpenRecordset("tblMfrnumDescMatch")
Set rsMfrnum = CurrentDb.OpenRecordset("tblXrefInfo", dbOpenTable) ' Xref Information

Question by:fordraiders
    LVL 32

    Accepted Solution

    Seek can only be used on a dbOpenTable type recordset

    Set the contianing datbase as an object and try from there

    set db = dbengine(0).opendatabase("c:\foldername\databasename.mdb",dblanggeneral)
    set tbl = db.openrecordset("tablename",dbopentable)
    LVL 32

    Expert Comment

    don't forget to set your index for use also...
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    From the Help File - you cannot use Seek on a  Linked Table

    "You can't use the Seek method on a linked table because you can't open linked tables as table-type Recordset objects. However, if you use the OpenDatabase method to directly open an installable ISAM (non-ODBC) database, you can use Seek on tables in that database."

    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    Sorry ... hit Submit by accident.

    Clarification .... You can open tables (not linked) in an external database and then use Seek.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now