Discussion:
Error in WinInet api???
(too old to reply)
Paulo Ventura
2004-09-28 20:09:37 UTC
Permalink
Hi,

I'm writing a program in Microsoft Access that simulate a
send to a web page.

There are some problems like:
1- In Access 97 / windows 95, the HttpSendRequest work
fine, but in Access 2000 / windows XP or Windows 2000 the
function don´t work, and don't return any error code...

Any ideia???

==============================
Dim hInternetOpen As Long
Dim hInternetConnect As Long
Dim hHttpOpenRequest As Long
Dim Server, URL, PostInfo As String
Dim PostLen As Long
Dim bResult As Boolean
Dim Buf As String
Dim BufLen As Integer
Dim Err As Long
Dim hFile As Long
Dim sReadBuffer As String * 1024
Dim sBuffer As String
Dim qinfo, lNumberOfBytesRead As Long
Dim bDoLoop, bRet As Boolean
Dim vrs As Integer

Server = "elektronet"
URL = "/res_aval.asp"
PostInfo = ""

hInternetOpen = InternetOpen("CGCONTRATA", _
INTERNET_OPEN_TYPE_PRECONFIG, _
vbNullString, vbNullString, 0)

hInternetConnect = InternetConnect(hInternetOpen, Server,
INTERNET_DEFAULT_HTTP_PORT, _
vbNullString, vbNullString, INTERNET_SERVICE_HTTP, 0, 0)

hHttpOpenRequest = HttpOpenRequest
(hInternetConnect, "POST", URL, _
"HTTP/1.0", vbNullString, 0, INTERNET_FLAG_RELOAD,
0)

PostInfo = "mes_ref=04"
PostLen = Len(PostInfo)

bResult = HttpSendRequest(hHttpOpenRequest, vbNullString,
0, PostInfo, PostLen)
=======================================================
Brian Combs
2004-10-08 19:43:20 UTC
Permalink
Hello
You can use the following article to test with.
259100 SAMPLE: Vbhttp.exe Demonstrates How to Use HTTP WinInet APIs in
Visual
http://support.microsoft.com/?id=259100

Thanks
Brian [MSFT]
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Paulo Ventura" <***@discussions.microsoft.com>
| Sender: "Paulo Ventura" <***@discussions.microsoft.com>
| Subject: Error in WinInet api???
| Date: Tue, 28 Sep 2004 13:09:37 -0700
| Lines: 55
| Message-ID: <3d7801c4a597$1463dc30$***@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: quoted-printable
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcSllxRjlmkpDEdKTw+AJrKjtC7fxQ==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.inetsdk.programming.wininet
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.inetsdk.programming.wininet:11375
| NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
| X-Tomcat-NG: microsoft.public.inetsdk.programming.wininet
|
| Hi,
| I'm writing a program in Microsoft Access that simulate a
| send to a web page.
| There are some problems like:
| 1- In Access 97 / windows 95, the HttpSendRequest work
| fine, but in Access 2000 / windows XP or Windows 2000 the
| function donŽt work, and don't return any error code...
| Any ideia???
| ==============================
| Dim hInternetOpen As Long
| Dim hInternetConnect As Long
| Dim hHttpOpenRequest As Long
| Dim Server, URL, PostInfo As String
| Dim PostLen As Long
| Dim bResult As Boolean
| Dim Buf As String
| Dim BufLen As Integer
| Dim Err As Long
| Dim hFile As Long
| Dim sReadBuffer As String * 1024
| Dim sBuffer As String
| Dim qinfo, lNumberOfBytesRead As Long
| Dim bDoLoop, bRet As Boolean
| Dim vrs As Integer
|
| Server = "elektronet"
| URL = "/res_aval.asp"
| PostInfo = ""
|
| hInternetOpen = InternetOpen("CGCONTRATA", _
| INTERNET_OPEN_TYPE_PRECONFIG, _
| vbNullString, vbNullString, 0)
| hInternetConnect = InternetConnect(hInternetOpen, Server,
| INTERNET_DEFAULT_HTTP_PORT, _
| vbNullString, vbNullString, INTERNET_SERVICE_HTTP, 0, 0)
|
| hHttpOpenRequest = HttpOpenRequest
| (hInternetConnect, "POST", URL, _
| "HTTP/1.0", vbNullString, 0, INTERNET_FLAG_RELOAD,
| 0)
|
| PostInfo = "mes_ref=04"
| PostLen = Len(PostInfo)
|
| bResult = HttpSendRequest(hHttpOpenRequest, vbNullString,
| 0, PostInfo, PostLen)
| =======================================================
|

Continue reading on narkive:
Loading...