Solved

VB5 Internet Question

Posted on 1998-08-31
6
207 Views
Last Modified: 2010-04-30
Was wondering if anyone can help to point me in the right direction with this project:

I need my app created in VB5 to look in a database for a list of URLs.  Take each URL, one by one, and look in the source code of that URL's site for a specific word, then record for each URL, whether or not that keyword was found, then move to the next til the end of the list is reached.  If the URL can't be loaded, then the app would move to the next one, maybe in a certain time.

I'm game for using an ActiveX control, or anything for that matter.  Any help would be appreciated.  Points will be awarded to the person who give the most detailed help/instructions.. Thanks!
0
Comment
Question by:EvanL
  • 4
  • 2
6 Comments
 

Expert Comment

by:AJElcocks
ID: 1432145
You can use the Microsoft INET ActiveX control to retrieve files via the web using http or ftp. The files and doc are available for download from the MSDN. Look for the internet sdk.

Dim sHtml as string
sHtml = MDIForm1.Inet1.OpenURL("http:\\whatever")

The value is returned to sHtml since the OpenURL method is not Asynchronous, so be certain to set the RequestTimout parameter. You can, however, check the StateChanged event for results and retieve data in chunks...

Private Sub Inet1_StateChanged(ByVal State As Integer)
        Dim sDtTm As String, rc As Integer
        Select Case State
        Case 11 'icError
            'Error processing here
            Exit Sub
        Case 12 '
            sData = Me.Inet1.GetChunk(length, 0)
           
        Case Else
            'interim "handshake" stuff explained in doc
        End Select
End Sub

Then use the InStr function to look for your keywords.


good luck
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432146
AJElcocks:  Thanks for the info.. I'm opening the question for a few different suggestions, but will award points to the best, most comprehensive answer.  I'm only going to keep it open for maybe 5-7 more replies, then get the person with the best answer to re-submit theirs as an answer.

Thanks!
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432147
A question.. I know how to get a webpage using the Inet control, but not just the source code (which is all I need).  I don't need a visual page, but the HTML behind it.

Thanks!
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Accepted Solution

by:
AJElcocks earned 100 total points
ID: 1432148
Open a new project in VB then right click on the toolbox. Select "Microsoft Internet Transfer Control" (NOT Microsoft Internet Controls) and click OK.

Put two text box controls on a form. Keep text1 as single line, make Text2 multiline.

Place the following code in the form...

Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
        RichTextBox1.Text = Inet1.OpenURL(Text1.Text, 0)
    End If
End Sub

Run the project, key "www.experts-exchange.com" in Text1 and press enter. You will see the source code in text2.
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432149
A question.. I know how to get a webpage using the Inet control, but not just the source code (which is all I need).  I don't need a visual page, but the HTML behind it.

Thanks!
0
 
LVL 1

Author Comment

by:EvanL
ID: 1432150
AJElcocks: Thanks for the perfect reply..  Any additional info you might have on this topic would be greatly appreciated..

EvanL
imagix@vni.net
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question