Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read html input in access

Status
Not open for further replies.

QTip

Programmer
Mar 7, 2001
66
BE
Hello,

This is the situation. I have some html files that are being saved automatically in a certain directory "test".
Now I need some information from the html file being saved in an access database. The program to save the data in an access database will be ran on the server so every 5 minutes he has to check wether there is a new html file.

The html file has some standard titles with some information behind it. ex: ordernumber: 1111. The "ordernumber:" is standard and is the same in every html file. it's the 1111 I need in a database.

Can somebody help me with this because I can't seem to find the right answer...

Thanks in advance!
 
This is maybe not the best way to do this, but it will work.

Code:
Open "C:\Test.htm" for input as #1

Do While EOF(1) <> False
Input #1, RawData$
If Instr(RawData$,&quot;ordernumber&quot;) <> 0 then
OrdNum = mid(RawData$,Instr(RawData$,&quot;ordernumber&quot;) + 12,5)
end If
Loop

This code will look for the string &quot;ordernumber&quot; get the 5 digit number after it (and the space). You should be able to adapt it for what you need to do.

calculus
 
thanks man! Gonna check it right away!
 
Well, I tested it ... and it worked :D

But rightnow the program searches for ordernumber and counts 12 places further, then he takes the next 5 places.
But the html file I use, I need more only the ordernumber.

So the program can't search for 12 characters and then take the next 5.
an example:
at line 1 we have &quot;ordernumber&quot;, so then it works.
But at line2 we have &quot;address&quot;. We need the characters behind &quot;address&quot;, but these are a variable lenght. So we need everything after &quot;address&quot; until the next &quot;<&quot; from the html code.

and so on.. and so on... in total it are +/- 150 lines. So I can't do everything manual.
Is there a way to use the above code (from calculus) but with a variable length and a variable amount of lines?

It would be fantastic if somebody could help me.
Thanks in advance!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top