Click here to Skip to main content
11,577,710 members (61,953 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VBA
It seems like this should be easy, but I cannot find the syntax to open the target web page with WinHTTP.WinHttpRequest.5.1 in VBA (MS Access). Maybe this isn't the right forum for the question, but since the class is used in VB too, hopefully someone has the answer.

Basically I'm POSTing some parameters to an aspx page, which I would like to display after processing the Posted parameters.

Is this even possible?

Here is a subset of the code. the aPostBody string contains the parameters. The code behind thepage.aspx.vb gets the parameters and returns a response.

Dim WinHttpReq As Object 'WinHttp.WinHttpRequest
Dim stURL as string
dim aPostBody as string
dim aResponse as string
Set WinHttpReq = CreateObject("WinHTTP.WinHTTPRequest.5.1") 'New WinHttpRequest
stURL = ""
WinHttpReq.setRequestHeader "Content-Type", "multipart/form-data; boundary=" & boundWinHttpReq.Open "POST", stURL, False
WinHttpReq.Send aPostBody
aResponse = WinHttpReq.GetResponseHeader("theResponse")

However, instead of getting the response header, I would like to open the page using the parameters I just sent. Ie, if I'm passing a record number, I want the page to display a database record with that record number.

I realize I can pass a query string to open the page to a particular record, but I don't want it accessible that way.
Posted 15-Feb-12 17:22pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Peter Leow 180
1 Richard MacCutchan 175
2 DamithSL 150
3 OriginalGriff 135
4 Afzaal Ahmad Zeeshan 95
0 OriginalGriff 830
1 Sergey Alexandrovich Kryukov 701
2 Abhinav S 573
3 F-ES Sitecore 420
4 Dave Kreskowiak 374

Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 15 Feb 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100