search function
-
Hai,somebody can help me to write a search function in my program using vb6
-
Hai,somebody can help me to write a search function in my program using vb6
To search for...? In what -- a database? -- in text files? -- in all files? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
Hai,somebody can help me to write a search function in my program using vb6
Lim Goh Tong wrote (via email): Search in database. The records we search for must display in datagrid. can u send me same example of program? That is an extremely broad, general question, and as such, is very difficult to answer in this kind of forum. Assuming that you are accessing the records from some ODBC, OleDb or SQL data source, you would typically design a form on which a user would enter search parameters, then, since this is VB6, build a query string to execute on an ADODB command, return a record set and bind the record set to a grid. The high-level, general nature of your question makes me think this is something you may not have done before. I suggest searching for general ADO programming samples and tutorials on VB-related web sites as a starting point; then if you have more specific questions related to a particular sample or some of your own code, post it back here. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
Hai,somebody can help me to write a search function in my program using vb6
Brendon, I want to make sure we're still talking about Visual Basic 6; your earlier example and code led me to this conclusion, but if we are really talking about Visual Basic.NET, then there is much different approach. The code in the VS.NET magazine article (here[^]) was an excellent example of running a query and binding it to a MS Hierarchical Flex Grid on a Visual Basic 6 form. If you boil it down to the most basic elements, it looks like this:
Dim cnn As ADODB.Connection Dim rs As ADODB.Recordset Set cnn = New ADODB.Connection Set rs = New ADODB.Recordset cnn.Open "..." ' details omitted rs.Open "SELECT \* FROM Customers", cnn, adOpenKeyset, adLockOptimistic Set MyFlexGrid.DataSource = rs
However, I get the feeling from your recent inquiries (via email) that you are also concerned about the SQL syntax for joining a Customer Orders table on one or more Customer records. That would be fairly easy to produce, but I have no idea what your table looks like, so I can only offer the most basic suggestions, if that is the case. Let me know, OK? What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.