First thing to note as i'm not running a Windows machine, so this is from memory...
I played around with lots of VB6 HTTP methods and finally settled upon using WinHTTP as it auto-handles cookies which is very important if you're gonna scrape the website. Sooo, with that in mind, add a reference to the WinHTTP library something like Tools > References > Microsoft WinHTTP 5.1. Now create a Module and at the very top, declare a new WinHTTP object something like:Dim oHTTP As New WinHTTP.WinHttpRequest
Declaring it publicly like this allows your new WinHTTP object to track all cookies between different function calls.
Next i would recommend you install Live HTTP Headers in Firefox or IEHTTPHeaders in Internet Explorer so that you can actually monitor what the the web browser sends/receives and then emulate it in your VB functions. Next, you'll need to write a Login function:Public Function Login(username As String, password As String) As String
Dim s As String, sPostData As String
On Error GoTo ExitError
' create post data + header + send
s = "https://www.betfair.com/account/login/LoginAction.do"
sPostData = "languageSelector=en%2CGBR&username=" & username & "&password=" & password
.SetTimeouts 5000, 5000, 5000, 5000
.Open "POST", s, False
.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.SetRequestHeader "User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:126.96.36.199) Gecko/20061206 Firefox/188.8.131.52"
If .Status = "200" Or .Status = "302" Then
' check login status
s = .GetResponseHeader("Location")
If s = "http://www.betfair.com/account/login/LoginView.do?status=success" Then
Login = "SUCCESS"
Login = "FAIL"
' http error (usually 404 if site down)
Login = "HTTP ERROR " & .Status
Login = "FUNCTION ERROR"
I've never done this in Access but i've had it working in both Excel and VB6 so it should be a goer.