CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Find First

  1. #1
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181

    Find First

    Set db = DAO.Workspaces(0).OpenDatabase("rem.mdb", False, False, ";pwd=urs")
    Set dt = db.OpenRecordset("Name")
    this is how i am opening a database
    i dont have data control or ado on my form
    when i try to find with the coding
    dt.FindNext ("Jhon")
    i get an error message that "not supported by this object"
    and when i use this coding
    dt.FindNext = ("Jhon") or dt.FindNext = "Jhon"
    i get an error message argument not optional
    plzz help me





  2. #2
    Join Date
    Jul 2000
    Location
    Hawaii
    Posts
    281

    Re: Find First

    you need to open the database with a specific cursor type that supports findfirst - like snapshot I think - see help on the opendatabase function


  3. #3
    Join Date
    May 2001
    Posts
    24

    Re: Find First

    Hi

    you want search the name = "Jhon"

    Set db = DAO.Workspaces(0).OpenDatabas ("rem.mdb", False, False, ";pwd=urs")
    ' OpenRecordset (put the table name in)
    Set dt = db.OpenRecordset("Name")

    While Not dt.EOF And dt.Fields!Name <> "Jhon"
    dt.MoveNext
    Wend

    dt!Name ' is "Jhon"


    Gordon Ngai



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

Featured