Results 1 to 2 of 2

Thread: Quickest way to find a specific record

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    16

    Unhappy

    I've been using DAO and it's FindFirst method, but when I started using ADO I've had many problems with its Find method.

    For example rs.Find("reckey = '0153'") I always get the error "Rowset does not support scrolling backward."
    I've tried adOpenDynamic, adOpenForwardOnly, adOpenKeyset and adOpenStatic and still get the error

    But if I use adOpenDynamic and rs.Find("reckey = '0153' AND rectype = 'IU'") I get the error "Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another." I know that the reckey is set up as a Char(8) and rectype is Char(2).

    Can anybody see something that I can't? Am I using the Find method correctly? Is there a better way searching for a record using ADO?

  2. #2
    Guest
    Try using SQL

    eg

    Dim sSQL
    sSQL = " SELECT * FROM Tablename WHERE Field = 'Data' "

    I know that in DAO you go:

    Set RS = DB.openrecordset(sSQL)

    But I cant remember for ADO

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width