Sending HTTP Get Commands

P

PaulHilgeman

Each day when the new data is imported, I am now being asked to send
HTTP strings to an external website/database. I can send in fairly
simple XML format, with some of the parameters from my database.

How would I automatically do this? It would be simple enough to run a
query for all jobs added to the database today. Then I need to parse
out certain things like PO Number, Phone Number, Order Number etc, and
generate a string like this:

http://www.website.com/scripts/prog...allOrderNumber=62589&PhoneNumber=xxx-xxx-xxxx

The data like StoreNumber, InstallPO, InstallOrderNumber, Phone Number
all come from the data that is already in an access table.

So, once I get a query made, with all of the pertinent data, how do I
go about sending all of the HTTP GET commands.

Thanks!!!
 
B

bhicks11 via AccessMonster.com

Hi Paul,

I up and download via ftp regularly. Here's a rountine Dev Ashish has shared
on the web:

'This code was originally written by Dev Ashish
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
'Code Courtesy of
'Dev Ashish
'
Sub sFTP(stSCRFile As String)
'Usage Example:
' call sFTP("C:\temp\test.scr")
'Sample SCR File for NT/Win95 FTP
' lcd "c:\temp"
' open ftp.someserver.com
' anonymous
' (e-mail address removed)
' cd public
' binary
' get dead.letter dead.letter
' bye

Dim stSysDir As String
stSysDir = Environ$("COMSPEC")
stSysDir = Left$(stSysDir, Len(stSysDir) - Len(Dir(stSysDir)))
Call Shell(stSysDir & "ftp.exe -s:" & stSCRFile, , vbMaximizedFocus)
End Sub
'********** Code End *******

In my applications I use a DOS batch file that works great also. I zip my
file programmatically and then do this:

Here's an example:

First run a batch file with this in it:

ftp -s:c:\YourFolder\upftp.bat ftp.yourdomain

This is the UPFTP.BAT file contents:

Yoursite%yourdomain
YourPassword
lcd c:\YourFolder
binary
prompt
mput *.zip

bell
bye

Bonnie

http://www.dataplus-svc.com
 
S

Steve Schapel

Paul,

This is beyond the scope of macros. You will need to use VBA for this.

Set a Reference to 'Microsoft XML v5.0'. This will then give you access
to the XMLHTTP object.

Your code will then include something like this (skeleton air code!):

Dim MyxmlHTTP As xmlHTTP
Set MyxmlHTTP = New xmlHTTP
MyxmlHTTP.Open "GET", "http://…<your url>" , False
MyxmlHTTP.send
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top