Results 1 to 13 of 13

Thread: [RESOLVED] Build A Searching App. Like Google

  1. #1

    Thread Starter
    Member wietmie's Avatar
    Join Date
    Aug 2008
    Posts
    49

    Resolved [RESOLVED] Build A Searching App. Like Google

    Hai, i just wanna ask, is it possible to do a searching result like google using VB6.0, but google are too complicated, what i mean just, user put the searching word in the textbox, then it will display all possible result like hyperlink, then user can click the hyperlink and display the detail. Is it possible? What in my mind, the only idea i have is using datagrid, display all possible result in the datagrid, which is i'm working on it, but still difficult because i dont know how to make the data in the datagrid enable to be click. If someone here have before made the searching look like what i mention above, I really-really appreciate if he/she can guide me, if no one ever made it, then, i hope someone will help me with the datagrid.

    thanks a bunch all

  2. #2
    Fanatic Member newprogram's Avatar
    Join Date
    Apr 2006
    Location
    in your basement
    Posts
    769

    Re: Build A Searching App. Like Google

    do you mean using google search in you app?
    Live life to the fullest!!

  3. #3

    Thread Starter
    Member wietmie's Avatar
    Join Date
    Aug 2008
    Posts
    49

    Re: Build A Searching App. Like Google

    nops, its like, i have my own database, so the query base on my database, and let say there are blank textbox, and when user enter something to search such as company name, then the result must be more than one, so the result will be organize like google way, which is something like hyperlink that allow user to click, to view the detail of the hyperlink.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Build A Searching App. Like Google

    From another thread of yours I see that you have already got the actual Search part working, so what you need is the display side of things.

    I don't think you can do what you want with the DataGrid, so like in your other thread, I would recommend that you don't use it (here, or anywhere).

    Instead, try using the FlexGrid (see the link in my signature), or the ListView - which would be more apt here, as it has built-in functionality for expanding sections.

    For an example of how to use one, see the article How can I fill a ListView with values from a database? from our Database Development FAQs/Tutorials (at the top of the Database Development forum)

  5. #5

    Thread Starter
    Member wietmie's Avatar
    Join Date
    Aug 2008
    Posts
    49

    Re: Build A Searching App. Like Google

    Yeah, my searching part is working now because of people help me in this forum, and i'm working hard on it. Now, i learn the flexgrid or listview, and of course, must be too many error occur, i will seek help here.

    Thanks a lot

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Build A Searching App. Like Google

    So, is this issue resolved, or do you still have questions on the thread topic?

  7. #7

    Thread Starter
    Member wietmie's Avatar
    Join Date
    Aug 2008
    Posts
    49

    Re: Build A Searching App. Like Google

    I still have a question to ask, sorry for late reply. Now i successfully display the data in the listview. User enter something and display the possible result to the listview, now, user should be able to click one of the data display in the listview to view the detail of the particular data, this part i think is not cover in the artical from where si_the_geek gave it to me. and i already google it, and cannot find anything, can someone give me an article or link or keyword for me to google or give me some idea.

    thank u so much.

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Build A Searching App. Like Google

    Where is the details that are to be displayed stored and how are they related to what will be clicked in the Listview?

  9. #9

    Thread Starter
    Member wietmie's Avatar
    Join Date
    Aug 2008
    Posts
    49

    Re: Build A Searching App. Like Google

    Sorry, forgot to give a details. Here is where the part that i'm able to do and stuck here:



    There are the possible result appear and when i click sinar suria, i will link to the detail of it:


    i really dont know with what to start, so i cannot provide any code because i'm totally cannot find any reference.

    thank u very much for helping..

    Hack, can u help me with this please?
    Last edited by wietmie; Aug 27th, 2008 at 01:08 AM.

  10. #10

    Thread Starter
    Member wietmie's Avatar
    Join Date
    Aug 2008
    Posts
    49

    Re: Build A Searching App. Like Google

    Wahh.. waiting so long, no one can't help me? or this forum is dead?

  11. #11
    New Member
    Join Date
    Aug 2008
    Posts
    4

    Re: Build A Searching App. Like Google

    Quote Originally Posted by wietmie
    Wahh.. waiting so long, no one can't help me? or this forum is dead?
    I think the piece of code that you are looking for is the click event for when someone double-clicks on one of the search results. I would recommend using the ListView control to display your results and in one of the columns specify the record unique ID number as a reference.

    The code for this is as follows:

    Code:
    Private Sub lvwSearchResults_DblClick()
    
        Dim dbDatabase As Database
        Dim recRecord  As Recordset
        
        Set dbDatabase = OpenDatabase("C:\Database.mdb")
        Set recRecord = dbDatabase.OpenRecordset("Record", dbOpenDynaset)
        
        If Len(lvwSearchResults.SelectedItem.Text) = 0 Then
            Exit Sub
        End If
        
        Call recRecord.MoveFirst
        
        Do Until recRecord.EOF = True
            If recRecord.Fields("ID").Value = lvwSearchResults.SelectedItem.Text Then
                Call MsgBox("Name: " & recRecord.Fields("Name").Value & vbCrLf & _
                            "Address: " & recRecord.Fields("Address").Value _
                            , vbInformation, "Database Record")
                Exit Sub
            End If
            
            Call recRecord.MoveNext
        Loop
        
    End Sub

  12. #12
    Member
    Join Date
    Mar 2008
    Posts
    55

    Re: Build A Searching App. Like Google

    so you want to enter some info into a webform then click a button, well as long as the button and boxes have names, i can provide the code.

  13. #13

    Thread Starter
    Member wietmie's Avatar
    Join Date
    Aug 2008
    Posts
    49

    Thumbs up Re: Build A Searching App. Like Google

    Quote Originally Posted by anaru.hartley
    I think the piece of code that you are looking for is the click event for when someone double-clicks on one of the search results. I would recommend using the ListView control to display your results and in one of the columns specify the record unique ID number as a reference.

    The code for this is as follows:

    Code:
    Private Sub lvwSearchResults_DblClick()
    
        Dim dbDatabase As Database
        Dim recRecord  As Recordset
        
        Set dbDatabase = OpenDatabase("C:\Database.mdb")
        Set recRecord = dbDatabase.OpenRecordset("Record", dbOpenDynaset)
        
        If Len(lvwSearchResults.SelectedItem.Text) = 0 Then
            Exit Sub
        End If
        
        Call recRecord.MoveFirst
        
        Do Until recRecord.EOF = True
            If recRecord.Fields("ID").Value = lvwSearchResults.SelectedItem.Text Then
                Call MsgBox("Name: " & recRecord.Fields("Name").Value & vbCrLf & _
                            "Address: " & recRecord.Fields("Address").Value _
                            , vbInformation, "Database Record")
                Exit Sub
            End If
            
            Call recRecord.MoveNext
        Loop
        
    End Sub
    Dont know what to say, just thanks so much 100x times.. now my problem all solve. thanks for all who help me..... love u all, muah muah muah

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