CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2001
    Posts
    29

    ADO Search Record Function

    Can anyone show me the general code for a serch function? Here is the scenario:
    In a Product form, it contains Product Name, Unit Price. After a "search" button is clicked and input box will be displayed. This "Search" function is based on "Product Id". after "product Id" is entered, The program will find the corresponding record and display it on the Product form. The database is linked using ADODC. Please let me know how to code this program.


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

    Re: ADO Search Record Function

    The best way to perform sewrch is to use SQL. Enetr your RecordID to the input box and then execute the SQL
    Save your input into variable
    dProductID if it is a number
    sProductID if it is a string

    a.Number
    sSQL = "select * from YourTable where ProductID = " & dProductID
    b.String
    sSQL = "select * from YourTable where ProductID = '" & sProductID & "'"


    adodc1.DtaSource = sSQL

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

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

    Re: ADO Search Record Function

    adodc1.recordset.find "Product Id='" & productid & "'"


  4. #4
    Join Date
    Jun 2001
    Posts
    29

    Re: ADO Search Record Function

    So, after performing finding, i wish to know if this recrd exists in my database. What shall i do next?


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