Chidaz Level: Whizz Kid

 Registered: 29-06-2006 Posts: 15
|
Re: How to pull data from web page an insert in db
Try to use Microsoft Internet Control; Press Ctrl + T and look for that componet. Insert it on your form such that when you dial up using your Inet after it establishes a connection the put the following line of code;
WebBrowser.Navigate "Your URL"
Declare a temp Variable to Store your data that you want to pull from a web page.
search for it using the following code:
Public Function CheckFileDeleted(path As String) As Boolean
wWeb.Navigate2 strExist
If WebPageContains(path) = True Then 'check if the word is in page
' MsgBox path & " Found", vbInformation 'string is in page
tempvar = WebPageContains
Else
MsgBox path & " Not Found", vbCritical 'string is not in page
End If
End Function
Private Function WebPageContains(s As String) As Boolean
Dim i, x As Long, EHTML
'Get the number of all Files on the Page
For i = 1 To wWeb.Document.All.length
Set EHTML = _
wWeb.Document.All.Item(i)
'Search Thru All Files
'---------------------
If Not (EHTML Is Nothing) Then
If InStr(1, EHTML.innerHTML, _
s, vbTextCompare) > 0 Then
WebPageContains = True 'Set WebPage to TRUE when found
Exit Function
End If
End If
Next i
End Function
then you save your data into you database using tempvar.
Not tested, Hopefully it will help you to come up with the solution.
|