PC Review


Reply
Thread Tools Rate Thread

How to Read an Internet File

 
 
TC
Guest
Posts: n/a
 
      11th Nov 2003

"Chaplain Doug" <(E-Mail Removed)> wrote in message
news:074b01c3a7f5$58a28d60$(E-Mail Removed)...
> I want to programmatically open a file on the internet and
> read its HTML, line by line. When I try for instance:
>
> Open "http://mywebpages.comcast.net/dpruiett/index.html"
> For Input As #1
> I get an "Bad file name or number" error. Can anyone help
> me to accomplish what I am aiming for? Thanks.



Nice try - but *definitely* no banana that way!

Perhaps look ino the microsoft WebBrowser control. You drop that control on
your page, then use its .Navigate method to open the URL that you want.

Understand that HTML is not really a line oriented language. Parsing HTML is
way more complicated than reading it in "line by line". The HTML that a
website gave you today, comprising 50 lines of HTML, might be delivered in
40 lines tomorrow, and 85 lines the day afterwards!

HTH,
TC




 
Reply With Quote
 
 
 
 
TC
Guest
Posts: n/a
 
      11th Nov 2003

"SRCatAIS" <(E-Mail Removed)> wrote in message
news:6290A687-AB07-4FEF-A1E7-(E-Mail Removed)...
> Doug,
> You must use the activex control, Microsoft Internet Control, found in

the toolbox. This or the Microsoft Web Brower control can be directed to a
website. It will also give you access to the DOM. You can then extract the
document and read line by line. I have an app at the office that does this.
You can email me (E-Mail Removed) if you would like the code.
>
> Steven Cummings MCSE



He doesn't >must< hafta! He could do a few winsock calls (WSOCK32.DLL) to
send an HTTP request!

Do you know if there is any way to access the DOM *without* the webbrowser
control? I have HTML, & need to access the DOM, but I absolutely do not
want to inconporate the webbrowser control.

TIA,
TC



 
Reply With Quote
 
Chaplain Doug
Guest
Posts: n/a
 
      11th Nov 2003
I want to programmatically open a file on the internet and
read its HTML, line by line. When I try for instance:

Open "http://mywebpages.comcast.net/dpruiett/index.html"
For Input As #1

I get an "Bad file name or number" error. Can anyone help
me to accomplish what I am aiming for? Thanks.
 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      11th Nov 2003
"Chaplain Doug" <(E-Mail Removed)> wrote in message
news:074b01c3a7f5$58a28d60$(E-Mail Removed)
> I want to programmatically open a file on the internet and
> read its HTML, line by line. When I try for instance:
>
> Open "http://mywebpages.comcast.net/dpruiett/index.html"
> For Input As #1
>
> I get an "Bad file name or number" error. Can anyone help
> me to accomplish what I am aiming for? Thanks.


You can't really do it like that. You *may* be able to do line-by-line
access using calls to the Windows API, but I don't know much about that.
How about downloading the whole web page into a string variable, which
you could then parse to get the individual lines? You can do that using
the classes supplied by the InetTransferLib, downloadable here:

http://www.mvps.org/access/modules/mdl0037.htm

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
=?Utf-8?B?U1JDYXRBSVM=?=
Guest
Posts: n/a
 
      11th Nov 2003
Doug
You must use the activex control, Microsoft Internet Control, found in the toolbox. This or the Microsoft Web Brower control can be directed to a website. It will also give you access to the DOM. You can then extract the document and read line by line. I have an app at the office that does this. You can email me (E-Mail Removed) if you would like the code

Steven Cummings MCSE
 
Reply With Quote
 
Chaplain Doug
Guest
Posts: n/a
 
      12th Nov 2003
The Dev Ashish stuff
(http://www.mvps.org/access/modules/mdl0037.htm) did the
trick. Thanks.

Chaplain Doug
 
Reply With Quote
 
Fred Boer
Guest
Posts: n/a
 
      12th Nov 2003
Every time I see "Dev Ashish", my brain turns it into "Devilish"... And when
I see a Chaplain saying that the Devilish stuff did the trick, well... it
gave me a start! <g>


Best Wishes!
Fred Boer


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read from Internet file MacDermott Microsoft Access VBA Modules 0 14th Dec 2007 04:15 PM
PLease read and try this is a great service from internet, better than others read this woth only 5 minutes of your life. Sorry for my english FrancoVagni@gmail.com Microsoft Access Database Table Design 0 5th Mar 2007 03:10 PM
PLease read and try this is a great service from internet, better than others read this woth only 5 minutes of your life. Sorry for my english FrancoVagni@gmail.com Microsoft Access Security 0 5th Mar 2007 03:10 PM
PLease read and try this is a great service from internet, better than others read this woth only 5 minutes of your life. Sorry for my english FrancoVagni@gmail.com Microsoft Access Queries 0 5th Mar 2007 03:10 PM
PLease read and try this is a great service from internet, better than others read this woth only 5 minutes of your life. Sorry for my english FrancoVagni@gmail.com Microsoft Access Macros 0 5th Mar 2007 03:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:01 PM.