Solved

VB5 Internet Question

Posted on 1998-08-31
6
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 56
VBA/SQL - Connect to SQL server and pull data 4 152
vb6 connector to mongodb 2 163
pop out of webbrowser1 control vba6 5 52
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

751 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