Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vb6 InetControl Problem

Posted on 2010-11-20
2
Medium Priority
?
784 Views
Last Modified: 2013-12-25
In VB6 put the Internet Control and a ListBox.
Then this code:
--------------------------------------------

 Dim str As String
  Dim ary() As String
  List1.Clear
 
  DoEvents
 
strHTML = Inet1.OpenURL(Trim("xxxxxxxx"), icString)

         str = strHTML
         ary = Split(str, vbLf)
         Dim x As Integer
         For x = 0 To UBound(ary)
            If ary(x) <> "" Then
                List1.AddItem (ary(x))
          End If
         Next
-----------------------------------------------
for "xxxxxxxx" put in:
http://www.USATODAY.com 
and try it. YOu see the list box fills with text.
Now try:
http://www.whitepages.com/search/ReverseAddress?site_id=10583&street=7004%20POTTER%20RD&where=14047
and see the list box does not fill. Why ?
If you put the last URL into a browser.. you get a page and page source. ?
That is what I'm trying to get into the list box...page source for that URL.
0
Comment
Question by:p2pfire
2 Comments
 

Author Comment

by:p2pfire
ID: 34181148
?
0
 
LVL 22

Accepted Solution

by:
danaseaman earned 120 total points
ID: 34181981
Try using Winsock control.
Sample code can be found at:
http://www.ostrosoft.com/vb/projects/get_html_source.asp 

Tried both URLs and they work OK with above code.

The second link returns:

HTTP/1.1 301 Moved Permanently
X-Runtime: 0.00488
Set-Cookie: search_beta=0; domain=.168.2.181; path=/; expires=Mon, 21 Nov 2011 05:19:21 GMT
Set-Cookie: _wpn_sid=f4bf98369636be11358dbf378c9e525a; domain=.168.2.181; path=/
Cache-Control: no-cache
Content-Length: 161
Date: Sun, 21 Nov 2010 05:19:21 GMT
Connection: close
Status: 301 Moved Permanently
Location: http://www.whitepages.com/10583/search/ReverseAddress?street=7004%20POTTER%20RD&where=14047
Server: nginx/0.7.67
Content-Type: text/html; charset=utf-8

<html><body>You are being <a href="http://www.whitepages.com/10583/search/ReverseAddress?street=7004%20POTTER%20RD&where=14047">redirected</a>.</body></html>
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

824 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