-
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.
-
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.