[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
Re: Build A Searching App. Like Google
do you mean using google search in you app?
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.
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)
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
Re: Build A Searching App. Like Google
So, is this issue resolved, or do you still have questions on the thread topic?
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.
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?
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:
http://img527.imageshack.us/img527/476/detailpp7.th.jpg
There are the possible result appear and when i click sinar suria, i will link to the detail of it:
http://img411.imageshack.us/img411/4...viewwt9.th.jpg
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?
Re: Build A Searching App. Like Google
Wahh.. waiting so long, no one can't help me? :confused: or this forum is dead?
Re: Build A Searching App. Like Google
Quote:
Originally Posted by wietmie
Wahh.. waiting so long, no one can't help me? :confused: 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
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.
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 :afrog: :D