using ADODB.stream to get results from a url query

H

Harry Hudini

Hi,

I have an asp page that needs to display the string that is returned from a
cgi file.

As an example, if you enter http://mydomain.com/mycgi.cgi?98127398 in to a
browser, it will display YES or NO

I need to have my asp code query this url, get the resulting string, then
act upon it (basically use the answer to display a nice big tick or a big
cross).

I have been told that I can do it using ADODB.STREAM, but the code I have
found doesnt work no matter what i do

<!--#include file="adovbs.inc"-->
<%
dim theNumber
dim TheUrl
dim TheResponse
dim Ostream
theNumber=request.form("phone")
theUrl="http://mydomain/cgifile.cgi?" & theNumber
set oStream = server.CreateObject("ADODB.Stream")
oStream.Type = adTypeText
oStream.Charset = "ascii"
oStream.Open "URL=" & theurl, admoderead, 8
oStream.Position = 0
TheResponse=oStream.ReadText
response.redirect("result.asp?result=" & TheResponse)
%>

The ADOVBS.INC file resides in the same folder as this script.

Now, we mainly get this error;

ADODB.Stream error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/formhandler.asp, line 12


Line 12 being the .open line.

No matter what we do, we can't get it working.

My questions are
a) is this the correct way of doing what i need to do ??

b) If it is the correct way, why oh why isnt it working ?

We are running IIS5 Win2k

Thanks

--
________________________________________________
ADSSupport.net
http://www.adssupport.net
Dedicated free Active Directory ServicesT support

email: oliver.marshall@[email protected]
 
A

Aaron Bertrand - MVP

What are you talking about? Did you try any of the examples in the article
I posted? You hit a web page, parse the HTML that's sent as a response.
Nothing about XML there at all, it's just piggybacking on an object whose
primary purpose is to process XML.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top