Results 1 to 2 of 2

Thread: Search Button Code

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2001
    Posts
    19

    Search Button Code

    I would like to provide users the ability to search (search first and search next occurrence) for the values in any of the columns in datagrid. Can someone help me out with the code I need to put in a search button in a toolbar.

    I managed to create the toolbar through the "Toolbar wizard".

    Any help/start with the code will do . I am stuck. Can't find anything straight forward on VB 6 help.

    I am using ADO.

  2. #2
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    I would just use somehting like this:
    Code:
    Dim cn as New ADODB.Connection
    Dim rs as New ADODB.RecordSet
    Dim sql as String
    
    cn.Open("Your connection string")
    
    sql = "Select * from YourTable where "your search criteria"
    
    Set rs = cn.Execute(sql)
    
    'now you can just use rs.MoveNext to scroll through the recordset when they hit searchnext.

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