Creating search function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • elbatz
    New Member
    • Dec 2007
    • 14

    Creating search function

    Hello there..need help how to create search function in text box to search records from access database using vb6..thanks a lot
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    kindly post what you have tried as of now.

    Comment

    • elbatz
      New Member
      • Dec 2007
      • 14

      #3
      I am trying to create a search function in which if i input string in text box such as
      Macapagal as surname then it will show all the lists from table1 in access showing those records having a surname Macapagal.Those record will show in datagrid.

      Comment

      • creative1
        Contributor
        • Sep 2007
        • 274

        #4
        It not a very tough to design a simple search module:
        There are many different ways to do this one of the example is as following.

        1.Use a textbox to enter the string you want to search
        2.Add a command button for search purpose(you can work without this too)
        for search button write a dynamic query like this
        query= "select * form TABLE_NAME where Surname=' "& Text1.Text & " ' "
        3. Use you connection and connection string to get results and assign results
        to your grid.(A assume you know about this already)

        If you try this and post you code here. Someone can help you.

        Kind Regards

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          Originally posted by elbatz
          I am trying to create a search function in which if i input string in text box such as
          Macapagal as surname then it will show all the lists from table1 in access showing those records having a surname Macapagal.Those record will show in datagrid.
          I have asked you to post what you have tried so far.

          Refer post #2 and post here the same for further discussion.

          Comment

          • elbatz
            New Member
            • Dec 2007
            • 14

            #6
            Code:
            Private Sub Text1_Change()
            DE.searchBookCode Text1 & "%", Text1 & "%", Text1 & "%"
            DataGrid1.DataMember = "searchbookcode"
            DE.rssearchBookCode.Close
            End Sub
            this is my code using data environment in search function.How do I convert it in ADO Codes?

            Comment

            Working...