473,763 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Microsoft.XMLHT TP causes all GET values to revert to "0"

[ASP]
'GET THE HTML CONTENT FOR DISPLAY BAND ORIGIN
Dim bandOriginDropd own
On Error Resume Next
set scraper = Server.CreateOb ject("Microsoft .XMLHTTP")
if err then
bandOriginDropd own = ""
else
scraper.open "GET", path &
"/includes/soa_form_elemen t_plugin.inc.as p", false
scraper.send "tableID=2&fiel dID=1&typeID=0"
bandOriginDropd own = scraper.Respons eText
set scraper = nothing
end if
[/ASP]

This is a code snippet based upon a scrape on an included ASP script I
wrote that is designed to produce dynamically generated HTML form
element material based upon query string values that are read into
globally-included arrays:

[ASP]
Dim tableNameArray( 2)
tableNameArray( 0) = "event"
tableNameArray( 1) = "gb"
tableNameArray( 2) = "bands"

Dim fieldArray(4,2)
fieldArray(0,0) = "event_name "
fieldArray(0,1) = "event_date "
fieldArray(0,2) = "event_text "
fieldArray(1,0) = "last_name"
fieldArray(1,1) = "url"
fieldArray(1,2) = "fave_bands "
fieldArray(2,0) = "bandStyle"
fieldArray(2,1) = "bandOrigin "
fieldArray(2,2) = "bandDescriptio n"

Dim formElementType Array(3)
formElementType Array(0) = "dropdown"
formElementType Array(1) = "text"
formElementType Array(2) = "textarea"
formElementType Array(3) = "hidden"
[/ASP]

Here is the ASP script soa_form_elemen t_plugin.inc.as p:

[ASP]
<!--#include virtual=/soa/includes/val_global_vars _functions.asp -->
<%
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '''''
' file: soa_form_elemen t_plugin.inc.as p
'
' created by: Phil Powell on 7/24/2005 '
' '
' Produce a dropdown list of band-related items whereby the '
' Request.QuerySt ring collection object determines which field '
' you will obtain and data to produce into an HTML form '
' element type dictated by global variables tableNameArray and '
' fieldArray '
''''''''''''''' ''''''''''''''' ''''''''''''''' ''''''''''''''' '''''

Dim myField, formElementType
if IsNumeric(Reque st.QueryString( "tableID")) then tableName =
tableNameArray( Request.QuerySt ring("tableID") )
if IsNumeric(Reque st.QueryString( "tableID")) and
IsNumeric(Reque st.QueryString( "fieldID")) then
myField = fieldArray(Requ est.QueryString ("tableID"),
Request.QuerySt ring("fieldID") )
end if
if IsNumeric(Reque st.QueryString( "typeID")) then myElementType =
formElementType Array(Request.Q ueryString("typ eID"))

Response.Write( "tableID = " & Request.QuerySt ring("tableID") )

if not IsNull(myField) and myField <> "" and not IsNull(tableNam e)
and tableName <> "" then
Dim Conn, rs
Set Conn = Server.CreateOb ject("ADODB.Con nection")
Conn.Open "DRIVER={Micros oft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath( "\soa\db\sub.md b")

sql = "SELECT DISTINCT " & myField & " " &_
"FROM " & tableName & " " &_
"WHERE " & myField & " IS NOT NULL" &_
" AND " & myField & " <> '' " &_
"ORDER BY " & myField & " ASC"

set rs = Conn.execute(sq l)
if strcomp(lcase(m yElementType), "text") = 0 then
%>
<input name="my_<%= myField %>" size="50" maxlength="255" value="<%=
Replace(Request .Form("my_" & myField), """", "&quot;") %>">
<%
elseif strcomp(lcase(m yElementType), "textarea") = 0 then
%>
<textarea name="my_<%= myField %>" rows="8" cols="40"><%=
Replace(Request .Form("my_" & myField), "<", "&lt;") %></textarea>
<%
elseif strcomp(lcase(m yElementType), "hidden") = 0 then
%>
<input type="hidden" name="my_<%= myField %>" value="<%=
Replace(Request .Form("my_" & myField), """", "&quot;") %>">
<%
elseif strcomp(lcase(m yElementType), "dropdown") = 0 then
%>

<select name="my_<%= myField %>">
<option value="">Choose From Below:</option>
<option value="">------------------</option>

<%
do until rs.eof
%>

<option value="<%= rs("" & myField & "") %>"<%

if strcomp(Request .Form("my_" & myField), rs("" & myField & "")) =
0 then Response.Write( " selected")

%>><%= rs("" & myField & "") %></option>

<%
rs.moveNext
loop
set rs = nothing
%>

</select>

<%
end if ' END OF FORM ELEMENT TYPE SELECTION

end if ' END OF DISPLAY

Conn.Close
set Conn = nothing
%>
[/ASP]

Sorry so much code, but there is no way I can think of to explain my
problem.

Here is the output of the Response.Write:

tableID =
However, if I call the URL directly

http://www3.brinkster.com/soa/includ...dID=1&typeID=0

This is what I get:

tableID = 2
Could someone help me with this one? It's live and broken and I can't
fix it (up until 4:30am on this and have had no luck fixing it)

Thanx
Phil

Jul 25 '05 #1
3 1997


Phil Powell wrote:
[ASP]
'GET THE HTML CONTENT FOR DISPLAY BAND ORIGIN
Dim bandOriginDropd own
On Error Resume Next
set scraper = Server.CreateOb ject("Microsoft .XMLHTTP")
if err then
bandOriginDropd own = ""
else
scraper.open "GET", path &
"/includes/soa_form_elemen t_plugin.inc.as p", false
scraper.send "tableID=2&fiel dID=1&typeID=0"


A HTTP GET request does not have a request body so it makes no sense to
pass anything to the send method if you do open "GET".
If you want to pass values with a GET request then the only way is to
use the query string part of the URL e.g.
scraper.open "GET", path &
"/includes/soa_form_elemen t_plugin.inc.as p" &
"?tableID=2&fie ldID=1&typeID=0 "
Then soa_form_elemen t_plugin.inc.as p can read out
Request.QuerySt ring("tableID")
for instance.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 25 '05 #2
Thanx that's what I wound up trying last night for it to work. Please
explain why HTTP GET request does not have a request body yet HTTP POST
apparently does. They are both HTTP-based collection objects, so they
should both have a request body, just in different formats, one via the
URL and the other via an HTTP POST method.

Phil

Jul 25 '05 #3


Phil Powell wrote:
Please
explain why HTTP GET request does not have a request body yet HTTP POST
apparently does. They are both HTTP-based collection objects, so they
should both have a request body, just in different formats, one via the
URL and the other via an HTTP POST method.


Look into the HTTP specification, a HTTP GET request does not have a
request body, it consists solely of the request line and the request
headers.
POST or PUT requests have a request body.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 25 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
3167
by: MuZZy | last post by:
Hi, Lately i've been (and still am) fixing some memory leaks problems in the project i just took over when i got this new job. Among the other issues i've noticed that for localy created objects it makes difference to explicitly put them to null after working with them is done - it somehow makes the GC collect them sooner, like here: void SomeFunc() { MyClass c = new MyClass();
1
6589
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the server don´t response right. xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
0
1723
by: yma | last post by:
Hi, I have a web.config file that contains <httpHandlers> section that causes "cannot load file..." error. If I delete this section, it is OK. Why did vb.net add this section? It does not add this section now. Thank you. <!-- PREVENT SOURCE CODE DOWNLOAD This section sets the types of files that will not be downloaded. As well as entering a httphandler for a file type, you must also associate that file
3
37813
by: Ed | last post by:
Hi, I want to load data to a table in Sql Server from a dataset table in my vb.net app using a dataAdapter. I know how to do this as follows (my question is to see if I can reduce the amount of code below): .... Dim DA As SqlDataAdapter = New SqlDataAdapter Dim Parm As New SqlParameter ....
3
7678
by: ronlym | last post by:
hi, I have some client with IE 6 sp1 that when I run the following line I have an exception : var poster = new activexobject("Microsoft.xmlHttp"|); The web page that call this js line is ssl. Do you have an idea why it works on some computers and on others not? Thanks
5
2170
by: veaux | last post by:
I'm thinking this is easy but can't get it. I have a table with following: Table1 Date 1/1/2007 Table2 Type 0107 (This is MMYY of above) So I'm having trouble using a query to turn the date from Table 1 into
15
2680
by: arnuld | last post by:
-------- PROGRAMME ----------- /* Stroustrup, 5.6 Structures STATEMENT: this programmes *tries* to do do this in 3 parts: 1.) it creates a "struct", named "jd", of type "address". 2. it then adds values to "jd" 3.) in the end it prints values of "jd".
1
6087
by: H | last post by:
Just trying to create a basic xmlhttpobject. However, the following always returns null xmlhttpobj = New ActiveXObject("Microsoft.XMLHTTP") (it is Microsoft. and not Msxml2. I've already narrowed that part down; just trying to create the object now) If I check for the value of xmlhttpobj, it is always null or undefined.
13
3523
by: Javad | last post by:
Hello I know that I should get the information of windows internet connections by using "rasapi32.dll" library, and I also have some sample codes, but I can't make them work. My exact need is to get the "UserName" of a connection. How is it possible? plz hlp thnk u
5
6487
by: anEchteTrilingue | last post by:
Hi everybody. Thank you for reading my post. I am having trouble getting "this" to work in all versions of IE (it's fine in Firefox, opera, konqueror, etc). What I would like to do is add an event listener to an element to change its border on mouseover and mouseout. I don't want to use CSS to do this (long story). The problem is that "this" does not work at all in IE for me. I tried to do a try/catch statement and use...
0
9563
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9998
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.