Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Using .Seek with an ADO recordset.

Using .Seek with an ADO recordset.

Using .Seek with an ADO recordset.

I have found a problem using the .Seek method with an ADO recordset and cannot understand why it happens.  The .Seek method works well in itself (until the database is split, but I know why that happens now.) until used.  In certain circumstances, when the .Seek method is used, another instance of MSAccess appears to start running as a TSR when the database is exited.  While the MSAccess is running in the background (there are no windows or another hint as to its existence), Access will not work properly.

The only way I have found to kill the ghost instance of Access is to pick it out from Ctrl-Alt-Del and end the task.

Has anyone else found this error, or know of a way around it.?

RE: Using .Seek with an ADO recordset.

So stop using Seek and use SQL instead
Instead of this:
Dim MyDB As Database, rst As Recordset
    Set MyDB = OpenDatabase("\\SLMD\SYS\ACCESS\LEADTIME.MDB")
    Set rst= MyDB.OpenRecordset("LEADTIME")
        rst.Index = "PrimaryKey"
        rst.Seek "=", Me![Project].text
Use this:
Dim MyDB As Database, rst As Recordset ,SQL as String
    Set MyDB = currentdb
SQL = "Select * From [LEADTIME] Where [YourPrimaryKeyField] = " & Me![Project].text
Set rst = MyDB.OpenRecordset(SQL)

so you refer to the fields the same way
rst!yourfield = somevalue
somevalue = rst!yourfield

OK this is much faster than .SEEK
Plus you can create complicated multi-table queries in the Access QBE grid and paste the SQL code it creates in the above SQL statement.


Ask me how Bar-codes can help you be more productive.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close