Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Number Of Google Search Results


How can I get the number of Google search results for a certain keyword ?


Thanks in advance




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Creating Google Search URL {and Getting Results}
Ok, I understand that I can create a Google Search URL to search Google from my VB program. I have roughed out a code below for it, which I havent tried yet cos I have to get other stuff right first before I can try that out.


Code:
Dim StrSearchString as string
Dim Word1 as string
Dim Word2 as string

Word1 = "Hello"
Word2 = "world"

StrSearchString = "http://www.google.com/search?q=" & Word1 & "+" & Word2
Now, my question is...do I have to use anything, like Winsock or something else probably, so that my VB program can search Google? OR would it just work with the above code without using any other 'controls'?

Access Google Search Results?
Yep, thats right, more problem with inet....

Google is not giving me any search results just an error. I want my program to do a search so I can get the URL's.

I got:

VB Code:
Dim HTML As String    HTML = Inet1.OpenURL("http://www.google.ca/search?hl=en&q=Visual+Basic&btnG=Google+Search&meta=", icString)RichTextBox1.Text = HTML


I get:

Code:
<html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><title>403 Forbidden</title><style><!--body {font-family: arial,sans-serif}div.nav {margin-top: 1ex}div.nav A {font-size: 10pt; font-family: arial,sans-serif}span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight: bold}div.nav A,span.big {font-size: 12pt; color: #0000cc}div.nav A {font-size: 10pt; color: black}A.l:link {color: #6f6f6f}A.u:link {color: green}//--></style><script><!--var rc=403;//--></script></head><body text=#000000 bgcolor=#ffffff><table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td rowspan=3 width=1% nowrap><b><font face=times color=#0039b6 size=10>G</font><font face=times color=#c41200 size=10>o</font><font face=times color=#f3c518 size=10>o</font><font face=times color=#0039b6 size=10>g</font><font face=times color=#30a72f size=10>l</font><font face=times color=#c41200 size=10>e</font>&nbsp;&nbsp;</b><td>&nbsp;</td></tr><tr><td bgcolor=#3366cc><font face=arial,sans-serif color=#ffffff><b>Error</b></td></tr><tr><td>&nbsp;</td></tr></table><blockquote><H1>Forbidden</H1>Your client does not have permission to get URL <code>/search?hl=en&amp;q=Visual+Basic&amp;btnG=Google+Search&amp;meta=</code> from this server. (Client IP address: 24.***.***.***)<br><br>
Please see Google's Terms of Service posted at http://www.google.com/terms_of_service.html
<BR><BR><P>If you believe that you have received this response in error, please <A HREF="http://www.google.com/support/bin/request.py?contact_type=user&hl=en">report</A> your problem. However, please make sure to take a look at our Terms of Service (http://www.google.com/terms_of_service.html). In your email, please send us the <b>entire</b> code displayed below. Please also send us any information you may know about how you are performing your Google searches-- for example, "I'm using the Opera browser on Linux to do searches from home. My Internet access is through a dial-up account I have with the FooCorp ISP." or "I'm using the Konqueror browser on Linux to search from my job at myFoo.com. My machine's IP address is 10.20.30.40, but all of myFoo's web traffic goes through some kind of proxy server whose IP address is 10.11.12.13." (If you don't know any information like this, that's OK. But this kind of information can help us track down problems, so please tell us what you can.)</P><P>We will use all this information to diagnose the problem, and we'll hopefully have you back up and searching with Google again quickly!</P>
<P>Please note that although we read all the email we receive, we are not always able to send a personal response to each and every email. So don't despair if you don't hear back from us!</P>
<P>Also note that if you do not send us the <b>entire</b> code below, <i>we will not be able to help you</i>.</P><P>Best wishes,<BR>The Google Team</BR></P><BLOCKQUOTE>/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/<BR>
gkUGKcH872qi3ca292t7Isr-ec324lMvA7iI_SuCOJX6xREPy<BR>
P2DCiUseqWN8PIhtWoHPLHmhFQEKmWWJ4AdP-wUFaEQ7Pst8v<BR>
SIRcfw7T7-XozHNegzFGu43zZmz01yESbamZbrSKyw_HbNX5q<BR>
P5iAlV14P7h-aZEVxAJgH_Uk_fMNdAj095uDyPqGGHvpY1ymf<BR>
dtUbNEJMGdmeN3T3YipgsVtiYrNMxDf9W5uC_QSyodth80C8n<BR>
AME-W6Ha0_UlxR4_TOMN23wnq9GaOfvtBB9ZCOd5ktbHbInU2<BR>
XLaDRiOCnvRs78lVQcK8H5Rb7HpNVsFagVZuMtZRWx6slzZU3<BR>
X_rTSE1S0PKnBamoj_LUIiiXN9Bd9EReFmW1tHE-Z5nmyL3S9<BR>
CECtttqciUh4KDH9APK3_8OOoNTd0WVtqhe4nX8zcizoysKZM<BR>
NEPd03jgo9qEk5z1UrSJ2yPSwjM7c6wHcQl3ZEof3ddQTsp4N<BR>
7OaMK-zQQUwNiH1InJsOLzgAHRcvOMkYprb1LWPV6k1IJlPfS<BR>
tkefG9j4F-_MkA92g1EW0<BR>
+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+/+<BR></BLOCKQUOTE>


<p></blockquote><table width=100% cellpadding=0 cellspacing=0><tr><td bgcolor=#3366cc><img alt="" width=1 height=4></td></tr></table></body></html>

Read Google Image Search Results And Show Images In Picture Boxes
hi there,

i'm a newbie in vb, so please appologize any silly questions. i searched the forum for answers already but couldn't find anything really helpful.

what i need is:
- ask google - (e.g. http://images.google.com/images?q=0671600419)
- wait for response
- parse html for 'imgurl's and
- load the first 6 images into picture boxes in a form

this is for a books collection (2000+) tool i'm writing for a friend of mine. i want to include a 'search for cover on the internet'-function to show the books cover picture ( not to judge the book, but to impress her ) and google quiet relieably returns them when searching for the books' isbn number.

so, please tell me: how can i ...
- get the html site so that i can search it for the 'imgurl' tag?
- load a picture from a url into a picture box?

any hints, links, tutorials? please help!
thanks!
bowZZer

Limiting Number Of Search Results?
Hello!

I've coded a SQL statement for my database, to retrieve certain records in between a date range.
Presently, my database has a total number of 50 records.

How would I go about coding some kind of 'counter', which would limit the user to pull up 10 records at a time?

For example, say I have 30 records out of my 50 which were on a certain date. Say, for example, on 7/10/03.
If a user does a search range for records that have been entered on that day (7/10/03), how would I get it to show the listing in sets of 10??

Counting Number Of Results In A String Search
Hi,

I have another string handling question for the group, since you have all
been so helpful in the past. Thank you.



Basically, I want to do something really simple:

Search a main string for a substring, then count how many times the
substring appears in the mainstring



e.g.

mainstring = "The man walked through the park, the man was
happy"

substring = "man"

Count = 2 (Because 'man' appears twice)



Now, to me this sounds like a very simple thing to do, (It is, right?) but I
have been working on it for 3 hours now and it's starting to make my brain
hurt.



The problem I am having (Take the main string I mentioned earlier, searching
for "Man") is moving the searcher to the right position. The second "man"
in my mainstring is at position 38. If the searcher gets to position 10 it
finds it at position 38 (so count = 2), if it moves to position 15, it finds
it at position 3 (count = 3), and as it continues until it gets past the
position it counts it every time it sees it.



I've tried coding so that every time a position is duplicated, count = count
+ 1 - 1. It works if the position occurs twice, but anymore than that
counts it! I think somehow I need to store the previous position count in a
variable, then check it with the current one and change the count number
accordingly. But i can't seem to get there!



I think my code is nearly there, it just needs a little something extra.
Can anyone help please?



Here is my code (I popped lots of msgboxes in there to try and help me see
where I was going wrong - to no avail!):



Dim mainstring As String 'Declare Variables

Dim searchstring As String

Dim searcher As Integer

Dim count As Integer

Dim Startpoint As Integer



mainstring = " " & txtMain.Text 'Initialise variables

searchstring = txtSearch.Text



Do

Startpoint = Startpoint + Len(searchstring) + 1
'Calculate place to start searching mainstring

MsgBox ("Startpoint = " & Startpoint)

searcher = InStr(Startpoint, mainstring, searchstring) 'Search
mainstring for searchstring, starting from calculated start
point.

MsgBox searcher



If (searcher > 0) Then 'If position of searchstring in
mainstring is > 0 then

count = count + 1 'add 1 to counter

MsgBox ("+ 1 to count")

ElseIf searcher = searcher Then 'If position or searchstring is
found twice, then

count = count + 1

count = count - 1 'Minus 1 from counter

MsgBox ("-1 from count")

End If



MsgBox ("Count = " & count)

'Display position of found word



Loop Until searcher = 0 'Loop until there are no more words



End Sub



Thanks!



Cassandra

Automating Google Results For Pages
Hi,
I've been using VB6 primarily forwork with databases and parsing some texts and displaying dynamic web pages. I would like to know if there's a way to create a program with which I would input a number of web sites and it would chek online how many pages link to it and on what page on google it shows. I can do that manually on the google (typing link:%website% on google serch), but I have more than 100 sites and would like to automate this. Is there a way to achieve that. I need just a general guidance as to specific libraries, objects and methods I would need to create the prgram. Then I could do my research. Thank yu very much!

Google Search
I am working with excel and want to add an option button with a VB that would do a google search for the text entered into cell A1. Please can anyone suggest some code.

thanks

Google Search API And Vb
Hi all, does anyone has the code demonstrating how to use google search APIs in vb and develop a desktop customizable earch engine? If someone can show me how to use the APIs, I think I can do the customization bit myself.

Google Search In A Web Browser
i want to make a command that whatever is entered into a text box is then linked straight to a google search. how can i code this i have no clue??

Google Search Engine
Hi Guys,
Does anyone know how to embed the google search engine(or any search engine) in an ASP page? I am planning to provide a search box in my webpage that searches my webpage alone.

Thanks
SJ

Adding Google Search
On an application, I have added a text box with a go button. I have never setup a search like this and I have searched and can't find anyone that has.

I want to allow my clients to type in their search in the text box and press go and it will bring up the search in google.


VB Code:
' the go buttonPrivate Sub Command1_Click()    Shell ("explorer.exe " + Chr$(34) + "http://www.google.com/search?hl=en&q=" [b]How to I put the value of the text box here?[/b]" " + Chr$(34))End Sub


What do I put for the text box? Thanks in advanced.

Google Search, Adsense, From Vb
I belong to google adsense
I have vb prorams i sell. I am adding a google search textbox. . I am using shellexecute.
I am using this codefound This code here by Jenova, works good
If InStr(1, strSearchString, " ") Then
strSearchString = Replace(strSearchString, " ", "+")
End If

Call ShellExecute(Me.hWnd, "Open", "www.google.com/search?hl=en&q=" & strSearchString & "&meta=", _
vbNullString, vbNullString, vbNormal)

How can i add my adsense account numbers to this code?

Search Records Like Google In SQL?
hi all
i want to know the fastest way to search records from a table. i am using sql 2000.

suppose i have product table with description like
IBM Hard Drive 20.0GB 7200 RPm,
Seagate Hard Drive 20.0GB 5400 RPm
and so on.


user input will be just= IBM 20.0

Now i want to display all the records that has words "IBM" and "20.0" in [Product Description] field.

i know i can use like '% IBM 20.0%' but that will not give me the above records as IBM and 20.0 dont appear in sequence.

Basically i want to have a search utility that searches like google.

hope i have expalined the problem.

bye
Mits

Google Search With Winsock
Hi
how can i google search with winsock ?
i use that code :
                     Code: str_entete_http = str_entete_http & _
                        "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*" & vbCrLf & _
                        "Accept -Language: fr" & vbCrLf & _
                        "Content-Type: application/x-www-form-urlencoded" & vbCrLf & _
                        "Accept -Encoding: gzip , deflate" & vbCrLf & _
                        "Referer: http://www.referer.com" & vbCrLf & _
                        "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)" & vbCrLf

google link : www.google.com/search?q=key
so how can i send data www.google.com/search?
i mean i have to use index.html or something like that...

Interface With Google Image Search
Hello.

I would like to know if there's a way to interface with google's image search engine.

I've been thinking of possibly coding an application that would be very flexible and could either manually or fully automatically search for images in google then show them on a form, thereafter it will add a manually or automatically selected image to the metadata for album art in mp3 file's.

I googled a bit and found an application someone created but it was coded in c# so i don't exactly want to learn another language.

Notes - I don't know much about programming since i only do it as a hobby, so i usually only learn what i need when i need it.

Thx.

How To Make Program Search Url In Google?
i want create program search URL (Google Search Control Components)

Thank you

AUTOMATED GOOGLE SEARCH FROM EXCEL
HELP,

I am NEW to VBA. For the moment I am working on a Macro who should READ the number of hits on a search term (this is in the right upper corner of the google SERP "Results 1-10 of approximately 124.092 for search term) I am interested in this number (124.092) this for a given list of search terms in excel.

I know it can't be that difficult, but I am struggling with "recording" a macro in excel which is not working because the macro opens for every search term a new google session which is not the right way of course.

Who could help me with this. 1.000 thanks in advance

pimpampulleke

How Does This Sound ? Make A Search Tool Bar Like The Google
I want to make a toolbar like the google one were I docks up with ie and I was going to add my own twist to it. I was go to use the have a google search box but add my adsense link to it so I make money each time some one search , I dont know if this vilates google terms and agreement yet?
But the thing I don't get is how do I install my program to the ie were like the google toolbar does?

Read Text File?? Search Google??
Hi,

I'm working on a plagiarism detector program. It needs to convert a MSWord document into a text file and then read the texts in the text file. I've done the converting part already and now my problem is I wanna know how I can have my program pick up a text file from a folder and read it...and then after it has finished reading the text, it goes to the next text file in the folder and repeat the process of reading, and this goes on until it has finished reading all the text files from the folder.

Also, as my program reads the texts in the text files, it'll need to search for the phrases, for example a 2-word phrase, on google. I've decided to do this by searching using a google search URL like, http://www.google.com/search?q=Hello+world, and then downloading the relevant Google search results with URLDownloadToFile (I also have written this part already), and parse the results as a string. My problem here is that I dont know how to write the google search URL part, like I have problems inserting the text read into the query part of the Google search URL.

So, that's my problem...and I hope someone would be able to help me out.

403 Error When Download Souce Code From Google Search
Hi, all

Searching the forum long time, but didn't get the answer...

My problem is, The "403 page " will be returned when i using Inet.openURL to open a query page. let's say the query item is "java", the url generated by google is http://www.google.com.sg/search?hl=en&ie=UTF-8&oe=UTF-8&q=java&btnG=Google+Search"

My code is:

strHtml = Inet1.OpenURL("http://www.google.com.sg/search?hl=en&ie=UTF-8&oe=UTF-8&q=java&btnG=Google+Search")

If i do the same thing to open a query page from yahoo, it works well, i don't know why google can't...

Anybody can help me??

Thanks a lot
dejie

Search And Search Results In Userform
I have userform with two textboxes at top, one labelled as 'search textbox'.I have listbox labelled as 'search results'.The other textbox labelled 'result textbox'.
If a user enters 3 letters in 'search text box',basing on a formula,results of that formula will display in listbox.After selecting the one of the value from list box the selected value has to be displayed in textbox2 'result textbox'.How this task can be acieved ?
my formula is =index(sheet1a$2:a$100,small(if(left(sheet1a$2:a$100,3)='search textbox'.value,row($1:$99))),row(a1)))
Thanks if any body help in this regard.

Search Results
Hello,
How can I make a program that gets the results of a search from google, for example I open
http://www.google.com/search?hl=en&i...visual+basic+6
this is a search for “visual basic 6”
how can I get the results using VB, I am mostly interested in getting the URLs and links.
thanks

Search Results
Hi,

I have to use a search form in VB. The result page will show all the records that matches with VB, as we normally see in webpages.

1) If i click on any of that record it should go to the modification page of the corresponding record.

2) Additionally there were check boxes also provided for each entry. If I select any of the check boxes, After clicking the Delete button under it should delete all the checked entries.

How can I do this, any help greatly appreciated. Is there any think like <a href..> in VB.

Thanks
Amjath

Search Results
I am trying to search the database and shwo the highest score into a caption box..

Here is the "attempt" at coding it but doesnt seem to work :/

Code:
 For gblA = 1 To 23
    If Val("0" & rs.Fields("Scratch " & Trim$(Str$(gblA)))) Then
     Val ("0" & rs.Fields("Scratch " & Trim$(Str$(gblA))) = Val(LblHighestScore.Caption))
    End If
Next


There are no error messages.

--------------------------------------------------------------------------------
I am a VB learner with huge ideas!! push yourself and you shall learn more

First Project: www.BowlAGE.co.uk (Forever GROWING!!)

I aim to assist the Ten Pin Bowling Instructors around the world with this!!!!
--------------------------------------------------------------------------------

Search Results
I'm using VB6 and Access 2000 for a simple application to add and view records. The information is in two tables, Customers and Listing information for each customer. I'm searching by company name by truncating the search string then searching the db for any matches. The problem is that my recordset ends up with only one record (I know there should be more based on my test search) When I execute the same SQL statement in Access I retrieve all the records I expect to. I can't understand why the recordset doesn't include all matches. Here's the code: Any help is greatly appreciated.

Code:
    'cboSearchType is the combo where user can pick the type of search to perform
    'this code if for type = "Customer"
    strType = cboSearchType.Text
    'verify text has been entered
    If txtSearch.Text <> "" Then
    'verify text is more than one character
        If Len(txtSearch.Text) > 1 Then
        'truncate text for searching
            strQuery = Left(txtSearch.Text, 2)
        Else
            MsgBox "Please enter at least 2 characters for your query"
            Exit Sub
        End If
    Else
        If txtSearch.Text = "Company" Or txtSearch.Text = "Issue" Then
            MsgBox "Please enter a query in the search box"
            Exit Sub
        
        End If
    End If
    'Set database
    'frmDisplay is the form with the data controls on it the form where
    'search results are displayed
    frmDisplay.datCust.DatabaseName = App.Path & "/NSBG.mdb"
    frmDisplay.datList.DatabaseName = App.Path & "/NSBG.mdb"
    'Perform search based on query
    If strType = "Company" Then
        strCustSQL = "SELECT * FROM Customers WHERE Left(Company, 2) = '" & strQuery & "'"
        frmDisplay.datCust.RecordSource = strCustSQL
        frmDisplay.datCust.Refresh
        'My own tests - Abs Pos = 0 and Rec Cnt = 1 when I test for "Co" (see DB file)
        MsgBox "Absolute Position " & frmDisplay.datCust.Recordset.AbsolutePosition
        MsgBox "Record Count" & frmDisplay.datCust.Recordset.RecordCount
        'Verify that recordset is not empty
        If frmDisplay.datCust.Recordset.AbsolutePosition >= 0 Then
            'find listing information from Listing table based on ID of customer found
            strID = frmDisplay.datCust.Recordset.Fields("ID")
            strListSQL = "SELECT * FROM BGRecord WHERE CustID = " & strID
            frmDisplay.datList.RecordSource = strListSQL
            frmDisplay.datList.Refresh
            'verify that listing information was found
            If frmDisplay.datList.Recordset.AbsolutePosition >= 0 Then
        
            Else
                MsgBox "No records found"
                Exit Sub
            End If
        Else
            MsgBox "No records found"
            Exit Sub

        End If

DB file is attached. Please let me know if there is more information needed for help.

How To Move A "word" Search From My Site To Www.google.com?
I want to put a text field in my web site and when the user search for a word, the word to be moved to Google and have the results of Google in my site or in a new window.

How Can I do that?


Michael Sakellis
Athens-Greece

How To Retrieve Search Results
Hello,

I want to send a string to google search and retrieve the search result from a desktop application. Not from a webpage.

Here is an example: user write some text in a textbox then press a button. The typed text will be transferred to google search engine and then the program retrieve the search result's link and show each link in a list box. I can't do that. Please help...

Kindest regards...
Shaoun1000

List Results Of A Search?
I would like to list the results of a text search that I am running on the contents of Outlook's folders (Inboxs, Sent Items etc.).
The attached code almost does this but it only displays the number of items found NOT the actual items themselves.
I would like to display all the found results in a list box so that I can click on them and open them up like you do when using 'Advanced Find' inside Outlook.
Any ideas?
Thank you.

I Don't Know How To List Results Of A Search?
Can anyone advise me on how to list the results of a search performed by using the code below?
I am using this code to find emails in Outlook via searches on subject line content.
Rather than just displaying the number of finds I would like to list the results using the ListView control, from where I can then open the emails.
Thank you very much.


Dim strSearchString As String
Dim lCountOfFound As Long

Sub WalkFolders()

Dim olApp As Outlook.Application
Dim olSession As Outlook.NameSpace
Dim olStartFolder As Outlook.MAPIFolder
Dim strPrompt As String

'Initialize count of folders searched
lCountOfFound = 0

' Get a reference to the Outlook application and session.
Set olApp = Application
Set olSession = olApp.GetNamespace("MAPI")

' Allow the user to input the search string.
strPrompt = "Enter the search string to be found in the subject:"
strSearchString = InputBox(strPrompt)

If strSearchString <> "" Then

' Allow the user to pick the folder in which to start the search.
Set olStartFolder = olSession.PickFolder

' Check to make sure user didn't cancel PickFolder dialog.
If Not (olStartFolder Is Nothing) Then
' Start the search process.
ProcessFolder olStartFolder
MsgBox CStr(lCountOfFound) & " messages were found."
End If

End If

End Sub

Sub ProcessFolder(CurrentFolder As Outlook.MAPIFolder)

Dim i As Long
Dim olNewFolder As Outlook.MAPIFolder
' late bind this object variable, since it could be various item types
Dim olTempItem As Object

' Loop through the items in the current folder.
' Looping through backwards in case items are to be deleted,
' as this is the proper way to delete items in a collection.
For i = CurrentFolder.Items.Count To 1 Step -1

Set olTempItem = CurrentFolder.Items(i)

' Check to see if a match is found
If InStr(1, olTempItem.Subject, strSearchString, 0) > 0 Then
lCountOfFound = lCountOfFound + 1

End If

Next

' Loop through and search each subfolder of the current folder.
For Each olNewFolder In CurrentFolder.Folders

If olNewFolder.Name <> "Deleted Items" Then
ProcessFolder olNewFolder
End If

Next

End Sub

Search Results In Datagrid
Im busy making a mok till/stock system for a project and am trying to show a search for a barcode in a database and showing the results on a database grid. heres my code:

blurb about searching for barcode....
if .nomatch then
show a message...
else
dbgTranPending.Columns(0).text = DatStock.Recordset.Fields("Barcode")
dbgTranPending.Columns(1).text = DatStock.Recordset.Fields("Name")
dbgTranPending.Columns(2).text = DatStock.Recordset.Fields("Price")
end if

This works fine for the first search but the next one just over-writes the first. Is there a way to change which row its showing the search data on or something?

Thanks
Rockerby

Displaying Search Results - Help!
Hi, I have written a video retrieval program which allows a user to search an Access database for video annotations. The program uses a data control and an SQL statement.

The program works but I am not happy with the way it displays the results.

First I connected a series of text boxes and added scrolling functionality (FindNext / FindPrevious) but I want to list all results for the user to see at once.

Next I tried using a datagrid which was better but one of my database fields is quite long and it wont fit onto one form (As far as I can see there is no way of using multiline) and it is difficult to navigate the results.

Is there a better way of listing my results? What I would really like is to dynamically list all returned records with an option button for each so that the user can select the video segment to play.

I am new to this forum but would really appreciate any advice.

Thanks

Monkey_Magic

Show Search Results
In regards to my earlier posting i need to show results of a search from a database.

Here is my code to search the db; where details.mdb is my db and Details is the table i am searching for field 'City'


Private Sub cmdSearchCity_Click()
Dim db As Connection
Set db = New Connection

db.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=details.mdb;"
Set adoRecordset = New Recordset
adoRecordset.Open "Select * from Details where City like '" & txtCitySearch.Text & "'", db, adOpenStatic, adLockOptimistic

End Sub

______

How can i now show the details of my results in a text box called txtShow.text. ????

For example if i search for a object with an origin city of NY, can i then show this objects ID number in txtShow.text

Thanks

Plotting Search Results
I'm obtaing specific information from a text file & I have to display them in different chart representation.

Through the help of marty, l was able to write my search code, which works fine, but i'm finding it difficult to view the results in chart.

I can't send the entire code cos of the length, can anyone help with this part?


VB Code:
Private Sub BarChat2_Click() Dim RowCount As Integer With MSChart1         .chartType = VtChChartType2dBar        .ColumnCount = 1        .RowCount = UBound(curword)        RowCount = 1 + occcount        For column = 1 To UBound(occcount)                For row = 1 To UBound(curword)        .column = 1        .row = RowCount        .Data = curword(row)        .RowLabel = curword(row)        row = row + curword        RowCount = RowCount + curword Next rowNext column     End WithEnd Sub


Main Issues:
'searchArray' is to hold the results of the Split command
'curword' is responsible for that specific word
'occcount is used to get the total number of times each word occurs in 'curword'

Without a doubt, it's wrong, but i'm still learning VB, so any help will be useful! I just want someone to point what is missing!

Thanks for Your Help

How To Search Kazaa And Get Results....
Does anyone know of a way to make a program that searches kazaa, and gives the results to the program?

Justin

Search Results In A Listbox
YoungBuck...
Thanks for the response. This works great in getting the data into a 2nd list box, but the search criteria is too strict. I need it to be non-case sensitive and able to pull data that may contain the search criteria but not match exactly. If the user enters al, for example, I need the 2nd list to show all occurences where it contains the string "AL", such as Allen, Alabama, talk, ALLEN G., With the code you supplied it has to be an exact match, case and all. Is there a way to broaden the search procedure?


Chris...
Thanks for the response as well. I'm using VBA so I don't know if that makes a difference, but when I ran the code you gave me it did not recognize .hwnd as valid...it gave me an error code "Method or data member not found". Is it because I'm using VBA?















I have a userform where I prompt the user to enter a string to search for. It's not an exact search, so there may be more than one answer (ie. user enters AL, search could find ALLEN, ALABAMA, ALSO, ALLEN JONES, ALLEN SMITH, etc). I want to be able to take all the possible responses and feed them back into a listbox where the user can then select the right one they were searching for.

Anyone have any thoughts?

[Edited by ctfreel on 01-05-2001 at 09:07 AM]

Displaying Search Results
hi everyone...

I have a big problem with my VB project that I'm doing now...

first of all I'm doing a very basic database entery for a call center...to record the clients information that we speak with, so I made a form with text entery (mostly like name, phone numbers...etc)
my programme saves perfectly to the database file.
my problem is in searching. I used this code for searching :

Code:


Data1.RecordSource = "SELECT * FROM tblTransaction WHERE NomM = '*" & txtMNom.Text & "*' or TelMaison = '" & mtxtTelMaison.Text & "'"

Data1.Refresh



the problem is that it does'nt work and I get nothing, all I get is that my form clears up
now what I realy would love to do is that I need to know the best way of displaying a list of results after a search has been performed.
As my application matches records to my search criteria, I would like to list these in a List Box that I have already created and called "lstSearch" and the results should be listed by date "txtDate" so that I can choose from the date and when I press on that date it would fill in my form.
is this possible to do or am I dreaming?

thanks in advance...
peace to all...

Displaying Search Results
hi everyone...

I have a big problem with my VB project that I'm doing now...

first of all I'm doing a very basic database entery for a call center...to record the clients information that we speak with, so I made a form with text entery (mostly like name, phone numbers...etc)
my programme saves perfectly to the database file.
my problem is in searching. I used this code for searching :

Code:


Data1.RecordSource = "SELECT * FROM tblTransaction WHERE NomM = '*" & txtMNom.Text & "*' or TelMaison = '" & mtxtTelMaison.Text & "'"

Data1.Refresh



the problem is that it does'nt work and I get nothing, all I get is that my form clears up
now what I realy would love to do is that I need to know the best way of displaying a list of results after a search has been performed.
As my application matches records to my search criteria, I would like to list these in a List Box that I have already created and called "lstSearch" and the results should be listed by date "txtDate" so that I can choose from the date and when I press on that date it would fill in my form.
is this possible to do or am I dreaming?

thanks in advance...
peace to all...

Displaying Search Results
Hey, I am writting a simple database program for a friend's business and I have set up a search form and I have essentially "split" the screen in half and on one half is where you enter in the search information and the other half is where the results are displayed. I am using a MSAcess database and it has to be able to display multiple results but     the user also has to be able to click on each of the results and be taken to the full record. My problem is I don't know how to handle the fact that there could be an indefinate amount of results to display and link each to the individual record. I appreciate any help someone could give me.

How To Process Search Results
Through an email I have received a file that contains "search results".
In Explorer you can search for files and save the result in another file.
How can I access the contents of such a file?

My goal is to transform the contents of such a file to text format so that I can process it
with batch tools.

- Copy and Paste to Notepad doesn't work
- I don't really want to write a file manager extension

Any hints welcome

How Can I Click On The Results Of A Search?
Hi, I have the following problem:
I have a textbox in which someone can write anything.Then he presses a button and the word is searched in the sql server and the results are shown in a datagrid. So far everyting is ok,and I dont' have any problem.

I want to know how I can do the following:

I want the user to be able to select the result he was looking for and when that happens a new simple form to open.

How can I do that?

If you know some other way that this can be done, even without the use of datagrid, please tell.

Thank you

Search Within A List And Return Results
Hy everybody

What I got, is a workbook containing 2 Excel-sheets.

The first sheet (SearchForm) is the "search-sheet" and the second (Epson), is a list with more than 19'000 IT-products (pc's, printers, monitors, digi-cams a.s.o.).

Now, I'm looking for a code to search for specific words within columns in a sheet and if the words are found, return the content of the whole row containing the maching word(s) in the sheet "SearchForm" from a specific position on downwards.

Example:

Type "Epson stylus" in cell "C2" -->> click on search-button.

The search should return everything containing the words "epson and stylus".

The results should be returned in the sheet "SearchForm" from cell "A7" on downwards.

Did you anderstand what I'm trying to do?

Please check the enclosed Excel-file (Search.zip).

Thank you in advance, Sasha

Returning Search Results In Datagrid
Hi guys, i am using MSflex datagrid, and i am trying to display in it the results of my search.

EX: a user performs a search on a particular string and i want to display in the datagrid all records in the database that contain the desired string.( no other records should be displayed expect for the ones returned from the search)

I am using MS access as my backend with DAO connection.

HOW DO I DISPLAY ONLY THE RECORDS THAT I NEED IN THE DATAGRID VS. ALL RECORDS CONTAINED IN THE DATABASE ???

Follow up questions: How can i remove certain columns, Can i have a completely unbound datagrid so that i could display information obtained from different databases.

thanx for the help

Array Population With Search Results
I would like to make a program that the user types in a word in a text box, pushes a command button and than search a field for any text that matches the text box, and then populate the result(s) into a label (or a label array). Kind of like this in pseudo code

txtQuery.text = "ca"
lblResult(0).caption = "cat"
lblResult(1).caption = "catapillar"
lblResult(2).caption = "catastrophe"
lblResult(3).caption = "three cats"
etc...

Any help (preferebaly code) would be great. This is my first database program that I have made with VB.

Thanks

Displaying Search Results In Datagrid
hi all i'm supposed to get results from a database and show them on a datagrid using a search button. will my code work? and any way to improve on it? comments pls....

Dim ds As DataSet
Dim dr As DataRow
Dim myConnection As New SqlClient.SqlConnection
Dim myCommand As New SqlClient.SqlCommand
Dim adapter As New SqlDataAdapter

DataGrid.Visible = True
ds = New DataSet
adapter.SelectCommand = myCommand
adapter.SelectCommand.CommandText = myCommand.CommandText
adapter.SelectCommand.Connection = myConnection
adapter.Fill(ds, "Result")

Try
myConnection.ConnectionString = "Integrated Security=etc etc;"
myConnection.Open()

If name.Checked = True Then 'see which checkbox is clicked
myCommand.CommandText = "SELECT artist,title,serial FROM database ORDER BY artist"
Else
If title.Checked = True Then
myCommand.CommandText = "SELECT artist,title,serialno FROM database ORDER BY title"
End If
myCommand.CommandText = "SELECT artist,title,serialno FROM database ORDER BY serialno"
End If
myCommand.Connection = myConnection

DataGrid.DataSource = ds
Catch
End Try

Comparing Images From Search Results...possible?
Is it possible to have a program to conduct a search via google, yahoo, etc for all pages containing a keyword to be listed then for the program to find all images on the resulted pages and compare the images pixel by pixel (color of pixel and placement of pixel) to a base image then have image URLS, the page they came from, and how many pixels they had in common logged to a file?

I've made a little image that may explain it better than I could.

View Search Results In A Listbox
Hi!

I would appreciate some help here...

I have a form where the user choose what he/she want to search the database for e.g. Name or Arrivaldate.
When the user has choosen what to search for he/she types in at text box what the search word is.
When the user click on the Search button the matching posts should be presented in the listbox.

This is my code so far:

VB Code:
Option Explicit Dim db As DatabaseDim rs As RecordsetDim max As LongDim i As LongDim ws As WorkspaceDim errormsgDim strSearchResults As String Private Function lstSearchName() If rs.RecordCount = 0 Then   errormsg = MsgBox("No posts where found.", , "Error")End If rs.MoveLastrs.MoveFirst max = rs.RecordCount rs.MoveFirst lstSupportSearch.Clear For i = 1 To max   lstSupportSearch.AddItem rs("Name")   rs.MoveNextNext i lstSupportSearch.Visible = True End Function  Private Sub cmdAdvancedSearch_Click() Dim strSearchString As StringDim datSearchString As DateDim boolArrival As BooleanDim boolName As BooleanDim boolSection As BooleanDim boolArrend As BooleanDim boolDeadline As BooleanDim boolFinished As Boolean strSearchString = txtSearchStringboolArrival = optArrivalboolName = optNameboolSection = optSectionboolArrend = optArrendboolDeadline = optDeadlineboolFinished = optFinished If boolName Then   strSearchString = txtSearchString   dtSearchSupport.Recordset.FindFirst ("Name='" & strSearchString & "'")End If If dtSearchSupport.Recordset.NoMatch Then   MsgBox "No posts where found."End If Call lstSearchName End Sub Private Sub Form_Load() Set ws = DBEngine.Workspaces(0)Set db = ws.OpenDatabase("data.mdb")Set rs = db.OpenRecordset("tblSupport", dbOpenTable) End Sub Private Sub Form_Unload(Cancel As Integer) frmNewSupport.Show End Sub


As for now, I can se ALL my posts in the listbox.
But I do not get a error message.

As an extra feature, it would be nice if the user could dblclick on one post in the listbox and get back to the main form with that post active...

Please help me...

Any API To Capture Search Results Of A File??
hi all,

i hav a file stored in multiple folders..i wanted to get the all the pathnames for that file (something like search results) . In file scripting object there is a metthod "FileExists" but it takes path name as argument.. so i wanted pathnames for that file..

or is there any API to capture search results of a file??

.hope someone will help me!!



thanX in advance

Printing Search Results From A DBGrid
I have written an ADO-based front-end to an MS Access database. The database is displayed in a datagrid format. After the user makes a query, the resulting "hits" are displayed in the datagrid. Next, the user clicks on each record (row in the datagrid) that he wants to print out. Then he clicks the Print button. Here is the code that is activated:


Public Sub Print_Click()

Dim rst As Recordset
Dim varRecords As Variant
Dim intRows As Integer
Dim intNumReturned As Integer, intNumFields As Integer
Dim intField As Integer, intRecord As Integer

Printer.Print ""
Printer.FontName = "Arial"
Printer.FontSize = 12
Printer.FontBold = False

intRows = grdDataGrid.SelBookmarks.Count - 1
Set rst = datPrimaryRS.Recordset
varRecords = rst.GetRows(intRows)
intNumReturned = UBound(varRecords, 2)
intNumFields = UBound(varRecords, 1)
For intRecord = 0 To intNumReturned
    For intField = 0 To intNumFields
       Printer.Print varRecords(intField, intRecord)
    Next intField
  Printer.Print
Next intRecord
Printer.EndDoc
intRows = 0
End Sub


Now, here is the problem: the marked records (rows) are not printed.

Any suggestions would be very much appreciated.

Thanks

Populate DataGrid With Search Results
hi there,
i am creating a search function where the user type in a string and the search result will populate the datagrid. How do i achieve this by using access2000 & vb6.0? I am having difficulty with the datagrid coding and i am using ADO.
thanx in advance

Copyright © 2005-08 www.BigResource.com, All rights reserved