Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. search function

search function

Scheduled Pinned Locked Moved Visual Basic
help
4 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lim Goh Tong
    wrote on last edited by
    #1

    Hai,somebody can help me to write a search function in my program using vb6

    J 3 Replies Last reply
    0
    • L Lim Goh Tong

      Hai,somebody can help me to write a search function in my program using vb6

      J Offline
      J Offline
      John Kuhn
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • L Lim Goh Tong

        Hai,somebody can help me to write a search function in my program using vb6

        J Offline
        J Offline
        John Kuhn
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • L Lim Goh Tong

          Hai,somebody can help me to write a search function in my program using vb6

          J Offline
          J Offline
          John Kuhn
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups