DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Find with ADO

  1. #1
    Caroline Guest

    Find with ADO


    Hi,
    I would like to know it is possible to make a find in ADO with a variable
    in a program with a recordset?


    ex: dim rs as adodb.recordset
    rs.find "Ticket_number" = iNumber

    Thank you.



  2. #2
    Brian Guest

    Re: Find with ADO


    "Caroline" <clacours@mobility.com> wrote:
    >
    >Hi,
    > I would like to know it is possible to make a find in ADO with a variable
    >in a program with a recordset?
    >
    >
    > ex: dim rs as adodb.recordset
    > rs.find "Ticket_number" = iNumber
    >
    > Thank you.
    >
    >

    You can use a variable like you have but it needs to be in the syntax: rs.find
    "Ticket_Number = '" & iNumber &"'"; This is used for string variables, for
    number variables you need not use the single quotes: rs.find "Ticket_Number
    = " & iNumber

  3. #3
    Dexter Guest

    Re: Find with ADO


    "Caroline" <clacours@mobility.com> wrote:
    >
    >Hi,
    > I would like to know it is possible to make a find in ADO with a variable
    >in a program with a recordset?
    >
    >
    > ex: dim rs as adodb.recordset
    > rs.find "Ticket_number" = iNumber
    >
    > Thank you.
    >
    >



  4. #4
    Dexter Guest

    Re: Find with ADO


    "Caroline" <clacours@mobility.com> wrote:
    >
    >Hi,
    > I would like to know it is possible to make a find in ADO with a variable
    >in a program with a recordset?
    >
    >
    > ex: dim rs as adodb.recordset
    > rs.find "Ticket_number" = iNumber
    >
    > Thank you.
    >
    >

    It would be dim rs as adodb.recordset
    > rs.find "FieldName=" & iNumber


    To then check if it was found you check for eof (assuming forward search)
    if rs.eof=true Then
    msgbox "No matches"
    End if






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center