CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181

    Urgent plzz help

    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.FindFirst ("Jhon")
    i get an error message that "not supported by this object"
    and when i use this coding
    dt.FindFirst = ("Jhon") or dt.FindNext = "Jhon"
    i get an error message argument not optional
    plzz help me


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Urgent plzz help

    You must specify what you re looking for

    dt.FindFirst "Firstname='Jhon'"





    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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

    Re: Urgent plzz help

    Sorry friend it is giving me same error
    "Object not supported for this type of object"


  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Urgent plzz help

    You can use SQL
    sSQL = "select * from Table where name = 'John'"
    open recordset dt using this SQL

    and if dt.RecordCount = 0 then ' record is not found

    otherwise

    sName = dt!Name

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  5. #5
    Join Date
    Aug 2000
    Location
    Namibia
    Posts
    139

    Re: Urgent plzz help

    Hi, some recordset types do not support the FindXXXX methods.
    Try specifying the Recordset to be a Snapshot or Dynaset.
    'Replace the dbOpenSnapshot const with dbOpenDynaset as you require
    set rsData = db.OpenRecordset(RecordsetSQL , dbOpenSnapshot)


    the syntax shown in the previous posting for the find methods is correct.


  6. #6
    Join Date
    Aug 2001
    Posts
    26

    Re: Urgent plzz help

    write the following code
    set rs = db.openrecordset("select * from xyz",dbopendynaset)

    then the next find sytax what you have specified is ok this should work.


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