Internet Transfer Control, only option?

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

Is itc the only option if one needs to post to a web site from within
access? I am looking for something better if there is such a thing.

Thanks

Regards
 
John said:
Hi

Is itc the only option if one needs to post to a web site from within
access? I am looking for something better if there is such a thing.

Sure, don't mess with that control and instead use the WinInet API directly. Much easier
to distribute. Search on "WinInet API".

You are advised that it isn't good etiquette to cross-post to all these groups. Pick the
most appropriate one or two; the first two in your list was sufficient.
 
Thanks for that. I have searched but have not found an example to post to a
url from behind an isa 2000 server. Any idea where I can find an example?

Thanks

Regards
 
This is all .net stuff and none of it relates to vba/access as far as I can
see.

Regards
 
John said:
This is all .net stuff and none of it relates to vba/access as far as
I can see.

You can use the MSXML.dll library to make an HTTP POST or GET request. Is that
what you're talking about? I use that to send data transfers from an Access app
to a java servlet but it should work for any URL.
 
I just need to post some data to a url. Are there any code examples
somewhere?

Thanks

Regards
 
John said:
I just need to post some data to a url. Are there any code examples
somewhere?


Dim oHttpPost As Object
Dim POSTData As String

Set oHttpPost = CreateObject("Microsoft.XMLHTTP")
oHttpPost.Open "POST", "Your URL", False
oHttpPost.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"

POSTData = "RequestType=SAMPLE_POST" & _
"&Field1= " & Variable1 & _
"&Field2=" & Variable2 & _
"&Field3=" & Variable3 & _
"&Field4=" & Variable4 & _
"&Field5=" & Variable5

oHttpPost.Send (POSTData )
 
Hi Rick

Many thanks for that. Any way to get the return data from site (itc
equivalent GetChunk) and any error code (itc ResponseCode)?

Thanks

Regards
 
John said:
Hi Rick

Many thanks for that. Any way to get the return data from site (itc
equivalent GetChunk) and any error code (itc ResponseCode)?

The object will have a Status responseText properties that you can read
after the "Send".

If oHttpPost.Status < 300 Then 'Response is OK
someStringVariable = oHttpPost.responseText
 
Hi Rick

Thanks for this. Very useful and all works fine. One last thing, is there a
way to add a proxy server's information somewhere ie for when making calls
from behind an isa server?

Thanks

Regards
 
John said:
Hi Rick

Thanks for this. Very useful and all works fine. One last thing, is
there a way to add a proxy server's information somewhere ie for when
making calls from behind an isa server?

Sorry, I don't know the answer to that.
 
Hi John,
AFAIK - XMLHTTP uses IE settings for proxy server. so you try to change
there.
 
John said:
This is all .net stuff and none of it relates to vba/access as far as I can
see.

Regards

The first link was not appropriate - it was C++; I apologize for that but the
second is a valid VB example for HTTP POST.

You can authenticate to a proxy using the WinInet API - specifically the
SetInternetOptions() call:

sUserName = getUserName()
If InternetSetOption(hConnection, INTERNET_OPTION_PROXY_USERNAME, _
ByVal sUserName, Len(sUserName)) = 0 Then
Err.Raise vbObjectError + 511, , "InternetSetOption-U"
End If

sPassword = getPassword() ' set password
If InternetSetOption(hConnection, INTERNET_OPTION_PROXY_PASSWORD, _
ByVal sPassword, Len(sPassword)) = 0 Then
Err.Raise vbObjectError + 512, , "InternetSetOption-P"
End If

There certainly may be other methods especially in .Net but this is a snippet from a
working distribute VB6 app. I chose the WinInet library as a way to avoid controls
and external libraries for distribution reasons preferring to work directly with
the API calls. Using WinInet requires Internet Explorer so its not a perfect solution for
distribution. But it is perhaps one method to consider.

If this intriques you Google WinInet and INTERNET_OPTION_PROXY_USERNAME to find examples.
 

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

Back
Top