By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,395 Members | 2,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,395 IT Pros & Developers. It's quick & easy.

Passing Recordset from an ASP page to another HTML page ?

P: n/a
I am looking for a way to pass an ADO recordset that has been retrieved in
an ASP page to another HTML-page. Is there someone who can provide me with a
small sample or a link to see how this is done?

regards,
Oscar
Jul 22 '05 #1
Share this Question
Share on Google+
27 Replies


P: n/a
"Oscar" <ok*@xs4all.nl> wrote in message
news:em**************@tk2msftngp13.phx.gbl...
I am looking for a way to pass an ADO recordset that has been retrieved in
an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is done?

regards,
Oscar

You could use ADO's ReadAll() and pass the result
(depending on how big the recordset is).
Jul 22 '05 #2

P: n/a
Hi McKirahan,
no way to pass the recordset directly like an argument of a page ?
"McKirahan" <Ne**@McKirahan.com> schreef in bericht
news:YI********************@comcast.com...
"Oscar" <ok*@xs4all.nl> wrote in message
news:em**************@tk2msftngp13.phx.gbl...
I am looking for a way to pass an ADO recordset that has been retrieved
in
an ASP page to another HTML-page. Is there someone who can provide me
with

a
small sample or a link to see how this is done?

regards,
Oscar

You could use ADO's ReadAll() and pass the result
(depending on how big the recordset is).

Jul 22 '05 #3

P: n/a
"Oscar" <ok*@xs4all.nl> wrote in message
news:OA**************@TK2MSFTNGP09.phx.gbl...
Hi McKirahan,
no way to pass the recordset directly like an argument of a page ?
"McKirahan" <Ne**@McKirahan.com> schreef in bericht
news:YI********************@comcast.com...
"Oscar" <ok*@xs4all.nl> wrote in message
news:em**************@tk2msftngp13.phx.gbl...
I am looking for a way to pass an ADO recordset that has been retrieved
in
an ASP page to another HTML-page. Is there someone who can provide me
with

a
small sample or a link to see how this is done?

regards,
Oscar

You could use ADO's ReadAll() and pass the result
(depending on how big the recordset is).


[ Please don't top post. ]

Via QueryString and name/value pairs?

How much data is in the record set?
WIll the total length exceed 1,000 characters?
Jul 22 '05 #4

P: n/a
Oscar wrote:
I am looking for a way to pass an ADO recordset that has been
retrieved in an ASP page to another HTML-page. Is there someone who
can provide me with a small sample or a link to see how this is done?

regards,
Oscar

Probably a variation on this theme:
http://www.davidpenton.com/testsite/...ver2client.asp

or the technique used in the dynamic listbox demo available here:
http://www.thrasherwebdesign.com/ind...asp&c=&a=clear

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #5

P: n/a
Most of the time it will count up to 200-300 characters.

In a very few cases it might exceed 1000 characters.

regards,
Oscar
"McKirahan" <Ne**@McKirahan.com> schreef in bericht
news:ZZ********************@comcast.com...
"Oscar" <ok*@xs4all.nl> wrote in message
news:OA**************@TK2MSFTNGP09.phx.gbl...
Hi McKirahan,
no way to pass the recordset directly like an argument of a page ?
"McKirahan" <Ne**@McKirahan.com> schreef in bericht
news:YI********************@comcast.com...
> "Oscar" <ok*@xs4all.nl> wrote in message
> news:em**************@tk2msftngp13.phx.gbl...
>> I am looking for a way to pass an ADO recordset that has been
>> retrieved
>> in
>> an ASP page to another HTML-page. Is there someone who can provide me
>> with
> a
>> small sample or a link to see how this is done?
>>
>> regards,
>> Oscar
>>
> You could use ADO's ReadAll() and pass the result
> (depending on how big the recordset is).
>


[ Please don't top post. ]

Via QueryString and name/value pairs?

How much data is in the record set?
WIll the total length exceed 1,000 characters?

Jul 22 '05 #6

P: n/a
Thanks for the links Bob.

I will study both ways to pass recordset although I did't expect to use XML
for passing the recordset.

I couldn't get the dynamic listbox example running. As I call the client
page a VBScript error warning that it needs a spacing character at row 55 :
<!doctype HTML public.....> is reported.

Oscar

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> schreef in bericht
news:%2****************@tk2msftngp13.phx.gbl...
Oscar wrote:
I am looking for a way to pass an ADO recordset that has been
retrieved in an ASP page to another HTML-page. Is there someone who
can provide me with a small sample or a link to see how this is done?

regards,
Oscar

Probably a variation on this theme:
http://www.davidpenton.com/testsite/...ver2client.asp

or the technique used in the dynamic listbox demo available here:
http://www.thrasherwebdesign.com/ind...asp&c=&a=clear

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #7

P: n/a
"Oscar" <ok*@xs4all.nl> wrote in message
news:#B**************@TK2MSFTNGP15.phx.gbl...
Most of the time it will count up to 200-300 characters.

In a very few cases it might exceed 1000 characters.

regards,
Oscar


[snip]

AFAIK QueryString 's limit is about 1,024 bytes.
Some characters will take 3 bytes; e.g. Space = %20.

More details about your problem may prove helpful.
Jul 22 '05 #8

P: n/a
Why not top post? It seems eminently more efficient to me in that it
eliminates having to scroll down on every post. Can you give me one good
reason?

Brian
"McKirahan" <Ne**@McKirahan.com> wrote in message
news:ZZ********************@comcast.com...
"Oscar" <ok*@xs4all.nl> wrote in message
news:OA**************@TK2MSFTNGP09.phx.gbl...
Hi McKirahan,
no way to pass the recordset directly like an argument of a page ?
"McKirahan" <Ne**@McKirahan.com> schreef in bericht
news:YI********************@comcast.com...
> "Oscar" <ok*@xs4all.nl> wrote in message
> news:em**************@tk2msftngp13.phx.gbl...
>> I am looking for a way to pass an ADO recordset that has been
>> retrieved
>> in
>> an ASP page to another HTML-page. Is there someone who can provide me
>> with
> a
>> small sample or a link to see how this is done?
>>
>> regards,
>> Oscar
>>
> You could use ADO's ReadAll() and pass the result
> (depending on how big the recordset is).
>


[ Please don't top post. ]

Via QueryString and name/value pairs?

How much data is in the record set?
WIll the total length exceed 1,000 characters?

Jul 22 '05 #9

P: n/a
Gazing into my crystal ball I observed "Brian Staff" <br********@cox.net>
writing in news:Ghvme.7096$vp.2713@fed1read07:
Why not top post? It seems eminently more efficient to me in that it
eliminates having to scroll down on every post. Can you give me one good
reason?


Google for Top Bottom Posting. You will be rewarded with a plethora of
reasons.

--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
Jul 22 '05 #10

P: n/a
You've made three points that need replies in your message. Top-posting
makes it very awkward to reply to these points. Interspersed replies make
the points being answered obvious. See below:

Brian Staff wrote:
Why not top post?
Because it makes it harder to specify which point in the OP is being
answered. The style of quoting I am using makes it obvious that I am
answering your first question.
It seems eminently more efficient to me in that it
eliminates having to scroll down on every post.
Snipping should be done, no matter which style of quoting is being used. I
will concede that lazy bottom-posters who don't adequately snip are just as
bad as top posters who don't snip.
Also, if you (the reader) need to refer to the original post while reading
the reply, you will do a lot more scrolling than you would if the replies
were interspersed.
Can you give me one
good reason?


I think the above covers this request. However, another reason is that
bottom posting (or better yet, interspersed) allows sigs to work correctly.
The sig should be the last item in a post, because most news readers will
treat everything appearing after the sig token (--) as a signature, either
snipping it in some cases, or graying it out in others. So if you top-post
and put your sig immediately after your reply, the text you are quoting (or
failing to snip) will be treated as if it was part of your sig. So, if you
solve that by moving your sig to the bottom of the post (leaving your reply
at the top), your sig is unlikely to be read. Of course, if you don't care
if anyone reads your sig, this won't bother you, but ...

<snip>

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #11

P: n/a
Oscar wrote:
Thanks for the links Bob.

I will study both ways to pass recordset although I did't expect to
use XML for passing the recordset.
It's pretty much the best/only way to pass a recordset to the client. Of
course, if you only wnat the data, and you don't need the recordset itself,
you can pass an array easily enough. Just put the data into an array, use
Join to merge the array elements into a string, pass the string, and use
Split to recreate the original array.

I couldn't get the dynamic listbox example running. As I call the
client page a VBScript error warning that it needs a spacing
character at row 55 : <!doctype HTML public.....> is reported.


That does not happen to me. Your browser/firewall/anti-virus/popup blocker
must be inserting extra html. You will have to troubleshoot this yourself.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #12

P: n/a
On Mon, 30 May 2005 10:08:35 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <#R*************@TK2MSFTNGP12.phx.gbl>
Oscar wrote:
Thanks for the links Bob.

I will study both ways to pass recordset although I did't expect to
use XML for passing the recordset.


It's pretty much the best/only way to pass a recordset to the client. Of
course, if you only wnat the data, and you don't need the recordset itself,
you can pass an array easily enough. Just put the data into an array, use
Join to merge the array elements into a string, pass the string, and use
Split to recreate the original array.


I prefer to pass it through the Response object itself where it streams
in binary and requires half or less of the bandwidth that XML does.
---
Stefan Berglund
Jul 22 '05 #13

P: n/a
Stefan Berglund wrote:
On Mon, 30 May 2005 10:08:35 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <#R*************@TK2MSFTNGP12.phx.gbl>
Oscar wrote:
Thanks for the links Bob.

I will study both ways to pass recordset although I did't expect to
use XML for passing the recordset.


It's pretty much the best/only way to pass a recordset to the
client. Of course, if you only wnat the data, and you don't need the
recordset itself, you can pass an array easily enough. Just put the
data into an array, use Join to merge the array elements into a
string, pass the string, and use Split to recreate the original
array.


I prefer to pass it through the Response object itself where it
streams
in binary and requires half or less of the bandwidth that XML does.


Could you provide a quick example?

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #14

P: n/a
On Mon, 30 May 2005 17:56:52 -0400, "Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote:
in <un**************@tk2msftngp13.phx.gbl>
Stefan Berglund wrote:
On Mon, 30 May 2005 10:08:35 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <#R*************@TK2MSFTNGP12.phx.gbl>
Oscar wrote:
Thanks for the links Bob.

I will study both ways to pass recordset although I did't expect to
use XML for passing the recordset.

It's pretty much the best/only way to pass a recordset to the
client. Of course, if you only wnat the data, and you don't need the
recordset itself, you can pass an array easily enough. Just put the
data into an array, use Join to merge the array elements into a
string, pass the string, and use Split to recreate the original
array.


I prefer to pass it through the Response object itself where it
streams
in binary and requires half or less of the bandwidth that XML does.


Could you provide a quick example?

Bob Barrows


Certainly, except that I just realized that the subject specified an HTML
page as the recipient. I responded to your statement that it was ~pretty
much the best/only way to pass a recordset to the client~ so this method
may not work to another HTML page although I think it should be possible.

ASP (no HTML) My connection object is set in my includes which are not
included, but all the rest is from your examples so I'm sure you know what
to do here. <g>

<%Option Explicit
Dim rs: Set rs = cn.Execute("get_Entries " & some parameters)
rs.Save Response: rs.Close: Set rs = Nothing: cn.Close: Set cn = Nothing%>

Your Client Side VB app: (note no connection object required here)
Dim rs As ADODB.Recordset: Set rs = New ADODB.Recordset
rs.Open "http://www.URL_of_above_asp_page.asp"
Dim ar: If (Not rs.EOF) Then ar = rs.GetRows
blah blah blah

The data streams through the Response object and probably should be
encrypted when necessary.
---
Stefan Berglund
Jul 22 '05 #15

P: n/a
Stefan Berglund wrote:

I prefer to pass it through the Response object itself where it
streams
in binary and requires half or less of the bandwidth that XML does.


Could you provide a quick example?

Bob Barrows


Certainly, except that I just realized that the subject specified an
HTML
page as the recipient. I responded to your statement that it was
~pretty
much the best/only way to pass a recordset to the client~ so this
method
may not work to another HTML page although I think it should be
possible.


Ah, that clears things up.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #16

P: n/a
On Mon, 30 May 2005 18:59:17 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <O7**************@tk2msftngp13.phx.gbl>
Stefan Berglund wrote:

I prefer to pass it through the Response object itself where it
streams
in binary and requires half or less of the bandwidth that XML does.
Could you provide a quick example?

Bob Barrows


Certainly, except that I just realized that the subject specified an
HTML
page as the recipient. I responded to your statement that it was
~pretty
much the best/only way to pass a recordset to the client~ so this
method
may not work to another HTML page although I think it should be
possible.


Ah, that clears things up.

Bob Barrows

Does it? Could you explain why it doesn't work based on the MSDN docs?

mk:@MSITStore:G:\MSDN\ado270.chm::/htm/mdmthrstopen.htm

Sure looks like it should work for another ASP page (URL) but I couldn't
make it work.
---
Stefan Berglund
Jul 22 '05 #17

P: n/a
Stefan Berglund wrote:
On Mon, 30 May 2005 18:59:17 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <O7**************@tk2msftngp13.phx.gbl>
Stefan Berglund wrote:
>
> I prefer to pass it through the Response object itself where it
> streams
> in binary and requires half or less of the bandwidth that XML
> does.
>

Could you provide a quick example?

Bob Barrows

Certainly, except that I just realized that the subject specified an
HTML
page as the recipient. I responded to your statement that it was
~pretty
much the best/only way to pass a recordset to the client~ so this
method
may not work to another HTML page although I think it should be
possible.


Ah, that clears things up.

Bob Barrows

Does it? Could you explain why it doesn't work based on the MSDN
docs?

mk:@MSITStore:G:\MSDN\ado270.chm::/htm/mdmthrstopen.htm

Sure looks like it should work for another ASP page (URL) but I
couldn't make it work.

I thought it would work. Do you get an error? Could we see the code that
produces the error?

I've never tried utilizing that functionality (using a url in the open
statement). Perhaps you are running into some security issues.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #18

P: n/a
Stefan Berglund wrote:
On Mon, 30 May 2005 18:59:17 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <O7**************@tk2msftngp13.phx.gbl>
Stefan Berglund wrote:
>
> I prefer to pass it through the Response object itself where it
> streams
> in binary and requires half or less of the bandwidth that XML
> does.
>

Could you provide a quick example?

Bob Barrows

Certainly, except that I just realized that the subject specified an
HTML
page as the recipient. I responded to your statement that it was
~pretty
much the best/only way to pass a recordset to the client~ so this
method
may not work to another HTML page although I think it should be
possible.


Ah, that clears things up.

Bob Barrows

Does it? Could you explain why it doesn't work based on the MSDN
docs?

mk:@MSITStore:G:\MSDN\ado270.chm::/htm/mdmthrstopen.htm

Sure looks like it should work for another ASP page (URL) but I
couldn't make it work.


I've got it working (this example is IE only):

ReturnRecordset.asp:
<%
dim cn, rs, sSQL

set cn = server.CreateObject("ADODB.Connection")
cn.Open "provider=sqloledb;data source=clnsqldev7;" & _
"user id = xxxx;password=xxxx"

sSQL = "Select CompanyName,ContactName,City " & _
"FROM Northwind..Suppliers"

set rs = createobject("adodb.recordset")
rs.CursorLocation=3
rs.Open sSQL,cn
set rs.ActiveConnection=nothing
cn.Close:set cn=nothing
rs.Save Response
rs.close:set rs=nothing
%>

RetrieveRecordset.htm:
<HTML>
<BODY>
<SCRIPT LANGUAGE=vbscript>
dim rs
set rs=createobject("adodb.recordset")
rs.Open "http://barrowbo/test_Local/ReturnRecordset.asp", _
"Provider=MSPersist;"
document.write rs.GetString(,," | ","<BR>")
rs.Close
set rs=nothing
</SCRIPT>
</BODY>
</HTML>

Even though I have made the decision to avoid using ADO on the client (due
to version, installation and incompatability issues), this is pretty cool.
It would probably be more useful in a VB client than a browser client.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #19

P: n/a
On Tue, 31 May 2005 10:08:34 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <ey**************@TK2MSFTNGP15.phx.gbl>


I've got it working (this example is IE only):

ReturnRecordset.asp:
<%
dim cn, rs, sSQL

set cn = server.CreateObject("ADODB.Connection")
cn.Open "provider=sqloledb;data source=clnsqldev7;" & _
"user id = xxxx;password=xxxx"

sSQL = "Select CompanyName,ContactName,City " & _
"FROM Northwind..Suppliers"

set rs = createobject("adodb.recordset")
rs.CursorLocation=3
rs.Open sSQL,cn
set rs.ActiveConnection=nothing
cn.Close:set cn=nothing
rs.Save Response
rs.close:set rs=nothing
%>

RetrieveRecordset.htm:
<HTML>
<BODY>
<SCRIPT LANGUAGE=vbscript>
dim rs
set rs=createobject("adodb.recordset")
rs.Open "http://barrowbo/test_Local/ReturnRecordset.asp", _
"Provider=MSPersist;"
document.write rs.GetString(,," | ","<BR>")
rs.Close
set rs=nothing
</SCRIPT>
</BODY>
</HTML>

Even though I have made the decision to avoid using ADO on the client (due
to version, installation and incompatability issues), this is pretty cool.
It would probably be more useful in a VB client than a browser client.

Bob Barrows


Cool. I burned an hour yesterday trying to make it work to another
page. Yeah, I use this method exclusively in my VB clients when
retrieving web based SQL data.
---
Stefan Berglund
Jul 22 '05 #20

P: n/a
Stefan and Bob thanks for your documented example and especially that you've
got it running now.
However, where is the action that the ASP page calls the other HTML page to
open in the client browser ?

Are there restrictions with respect to the size of the recordset when using
the resonse object?

Oscar

"Stefan Berglund" <ke****@in.thegroups> schreef in bericht
news:o7********************************@4ax.com...
On Tue, 31 May 2005 10:08:34 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <ey**************@TK2MSFTNGP15.phx.gbl>


I've got it working (this example is IE only):

ReturnRecordset.asp:
<%
dim cn, rs, sSQL

set cn = server.CreateObject("ADODB.Connection")
cn.Open "provider=sqloledb;data source=clnsqldev7;" & _
"user id = xxxx;password=xxxx"

sSQL = "Select CompanyName,ContactName,City " & _
"FROM Northwind..Suppliers"

set rs = createobject("adodb.recordset")
rs.CursorLocation=3
rs.Open sSQL,cn
set rs.ActiveConnection=nothing
cn.Close:set cn=nothing
rs.Save Response
rs.close:set rs=nothing
%>

RetrieveRecordset.htm:
<HTML>
<BODY>
<SCRIPT LANGUAGE=vbscript>
dim rs
set rs=createobject("adodb.recordset")
rs.Open "http://barrowbo/test_Local/ReturnRecordset.asp", _
"Provider=MSPersist;"
document.write rs.GetString(,," | ","<BR>")
rs.Close
set rs=nothing
</SCRIPT>
</BODY>
</HTML>

Even though I have made the decision to avoid using ADO on the client (due
to version, installation and incompatability issues), this is pretty cool.
It would probably be more useful in a VB client than a browser client.

Bob Barrows


Cool. I burned an hour yesterday trying to make it work to another
page. Yeah, I use this method exclusively in my VB clients when
retrieving web based SQL data.
---
Stefan Berglund

Jul 22 '05 #21

P: n/a

"Stefan Berglund" <ke****@in.thegroups> wrote in message
news:o7********************************@4ax.com...
On Tue, 31 May 2005 10:08:34 -0400, "Bob Barrows [MVP]"
<re******@NOyahoo.SPAMcom> wrote:
in <ey**************@TK2MSFTNGP15.phx.gbl>


I've got it working (this example is IE only):

ReturnRecordset.asp:
<%
dim cn, rs, sSQL

set cn = server.CreateObject("ADODB.Connection")
cn.Open "provider=sqloledb;data source=clnsqldev7;" & _
"user id = xxxx;password=xxxx"

sSQL = "Select CompanyName,ContactName,City " & _
"FROM Northwind..Suppliers"

set rs = createobject("adodb.recordset")
rs.CursorLocation=3
rs.Open sSQL,cn
set rs.ActiveConnection=nothing
cn.Close:set cn=nothing
rs.Save Response
rs.close:set rs=nothing
%>

RetrieveRecordset.htm:
<HTML>
<BODY>
<SCRIPT LANGUAGE=vbscript>
dim rs
set rs=createobject("adodb.recordset")
rs.Open "http://barrowbo/test_Local/ReturnRecordset.asp", _
"Provider=MSPersist;"
document.write rs.GetString(,," | ","<BR>")
rs.Close
set rs=nothing
</SCRIPT>
</BODY>
</HTML>

Even though I have made the decision to avoid using ADO on the client (due
to version, installation and incompatability issues), this is pretty cool.
It would probably be more useful in a VB client than a browser client.

Bob Barrows
Cool. I burned an hour yesterday trying to make it work to another
page. Yeah, I use this method exclusively in my VB clients when
retrieving web based SQL data.


The problem you will likely run into is that opening a recordset on a URL is
a.) synchronous, and b.) unforgiving. If anything goes wrong, you're
totally in the dark. (Even if you code your XML source to return errors as
XML, what are you going to do about HTTP errors?)

To mitigate these I like to use MSXML.XMLHTTPRequest (or the equivilent,
MSXML2.XMLHTTP, depending on version.) This gives you the ability to
examine whatever the URL returned, XML or otherwise, plus it can be used
asynchronously.

Recordset.Open also accepts an IStream as it's first parameter, and the
DOMDocument (that's retrieved in XMLHTTPRequest.responseXML) exposes an
IStream.

My 2 cents,
Mark



---
Stefan Berglund

Jul 22 '05 #22

P: n/a
Oscar wrote:
Stefan and Bob thanks for your documented example and especially that
you've got it running now.
However, where is the action that the ASP page calls the other HTML
page to open in the client browser ?
The html page controls the activity. When the .htm page is opened, it sends
a request via the rs.open statement to the asp page, which runs on the
server and returns the requested recordset. Obviously, you would use
querystring variables to pass parameters to the asp page via the url in the
Open statement to control what data is returned. In fact, using this method,
you are restricted to using the querystring, which is another reason I
prefer using the XMLHTTPRequest object, in addition to the reasons mentioned
by Mark.

Another factor to consider is passing the data back to an asp page. Using
the xmlhttprequest object makes it possible to pass the recordset back to a
server-side page.

Are there restrictions with respect to the size of the recordset when
using the resonse object?

None that I know of. When I experimented with passing recordsets to browser
clients, I made sure the recordsets were not very large (a few hundred rows
at the max). Usualy, I was passing around a disconnected recordset
containing a single row, using UpdateBatch to send changes back to the
database after the recordset had been processed by one or more pages.

Unfortunately, that application crashed and burned: it ran well in
development and testing on several machines. However, a week or so after it
went into production, we started getting calls: "createobject failed ..." on
this machine, "ADO error" on that machine ... updating/reinstalling MDAC on
those machines solved most of the problems, but there were a couple machines
which have never been able to run this app - MDAC was completely hosed on
those machines. As a result, I rewrote the app to remove any mention of ADO
in client-side code, and I have never written another app that used
client-side recordsets. Any client-side data processing is done via XML.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 22 '05 #23

P: n/a
Bob,
Snipping should be done, no matter which style of quoting is being used. I
will concede that lazy bottom-posters who don't adequately snip are just
as bad as top posters who don't snip.


You're right on about snipping and replying to a specific quote. But in
reality, that is not what most people do. If you`re going to reply without
snipping, then it just seems that top posting is better for me as a reader
than bottom posting. I just get annoyed at having to scroll down past stuff
I have already ready to see the reply. I usually make it a policy of mine to
skip over it if I have to scroll...unless I have a specific interest in the
thread.

So, it seems to me the issue not top posting versus bottom posting...but
whether the poster has bothered to snip or not. I'd rather see reminders
about snipping, which can also help reduce noise and bandwidth.

Brian - not really concerned about my sig line<g>
Jul 22 '05 #24

P: n/a
Hi Bob,

I've been able to draft an ASP page which opens a XML doc to retrieve the
recordset. It is able to display the recordset with the response object.

In this page there is an Active-X grid component (VSFlexgrid) which runs at
the client side and needs to be populated with the record data. I am able to
populate the grid with any data, but I can't refer to the recordset object :

fg.additem "Hi there" 'works good
fg.additem <% rs.Fields("naam") %> 'doesn't work, browser reports
Runtime error MS VBScript (0x800A01C2) wrong amount of arguments or illegal
property assignment : 'Fields'

fg=VSflexgrid
rs=Recorsdet Object

So the client is able to see the rs object since it is able to navigate
through the records, but can't display the value of the field. Any
suggestions?


This is the full ASP :

<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">

<%
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open =Server.Mappath("db_xml.xml")
Do While not rs.EOF 'this works good
response.write (rs.Fields("naam") & " " & (rs.Fields("woonplaats")
& "<br>"))
rs.movenext
Loop

%>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub window_onload
dim memo

' initialize grids
With fg
.FontName = "Verdana"
.FontSize = 9
.Editable = 2 ' flexEDKbdMouse
.BackColorFrozen = &H00E0E0E0&
.AllowUserResizing = 1 ' flexResizeColumns
.AllowUserFreezing = 3 ' flexFreezeBoth
.DataMode = 0 ' fgDMBound
.cols=4
.rows=1
end with

<% rs.movefirst
Do While not rs.EOF %>

fg.additem <% rs.Fields("naam") %>

<% rs.movenext %>
<% Loop %>
End Sub

sub fg_entercell()
with fg
if .col=2 then
Lijst_boekingstypen = "|#" & "deb" & ";" & "deb : betaling van debiteur"
& "|#" & "crd" & ";" & "crd : betaling aan crediteur"
Lijst_boekingstypen = Lijst_boekingstypen & "|#" & "std" & ";" & "std :
standaard" & "|#" & "sal" & ";" & "sal : salarisuitbetaling"
.combolist=Lijst_boekingstypen

'msgbox .col

else
.combolist=""
end if
end with
end sub
-->
</SCRIPT>
</head>

<body>

<!-- load licenses from LPK file -->
<object classid = "clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
<param name = "lpkpath" value = "vsf8.lpk">
</object>
<object classid="clsid:c945e31a-102e-4a0d-8854-d599d7aed5fa"
height=200 width=700
id=fg style="left:0px;top:0px">
<PARAM NAME="_cx" VALUE="9313"><PARAM NAME="_cy" VALUE="6773"><PARAM
NAME="Appearance" VALUE="1"><PARAM NAME="BorderStyle" VALUE="1"><PARAM
NAME="Enabled" VALUE="-1"><PARAM NAME="Font" VALUE="Times New Roman"><PARAM
NAME="MousePointer" VALUE="0"><PARAM NAME="BackColor"
VALUE="16777152"><PARAM NAME="ForeColor" VALUE="12582912"><PARAM
NAME="BackColorFixed" VALUE="-2147483633"><PARAM NAME="ForeColorFixed"
VALUE="-2147483630"><PARAM NAME="BackColorSel" VALUE="49344"><PARAM
NAME="ForeColorSel" VALUE="-2147483634"><PARAM NAME="BackColorBkg"
VALUE="-2147483636"><PARAM NAME="BackColorAlternate" VALUE="16777152"><PARAM
NAME="GridColor" VALUE="-2147483633"><PARAM NAME="GridColorFixed"
VALUE="-2147483632"><PARAM NAME="TreeColor" VALUE="-2147483632"><PARAM
NAME="FloodColor" VALUE="192"><PARAM NAME="SheetBorder"
VALUE="-2147483642"><PARAM NAME="FocusRect" VALUE="1"><PARAM
NAME="HighLight" VALUE="1"><PARAM NAME="AllowSelection" VALUE="-1"><PARAM
NAME="AllowBigSelection" VALUE="-1"><PARAM NAME="AllowUserResizing"
VALUE="0"><PARAM NAME="SelectionMode" VALUE="0"><PARAM NAME="GridLines"
VALUE="1"><PARAM NAME="GridLinesFixed" VALUE="2"><PARAM NAME="GridLineWidth"
VALUE="1"><PARAM NAME="Rows" VALUE="50"><PARAM NAME="Cols" VALUE="2"><PARAM
NAME="FixedRows" VALUE="1"><PARAM NAME="FixedCols" VALUE="0"><PARAM
NAME="RowHeightMin" VALUE="0"><PARAM NAME="RowHeightMax" VALUE="0"><PARAM
NAME="ColWidthMin" VALUE="0"><PARAM NAME="ColWidthMax" VALUE="0"><PARAM
NAME="ExtendLastCol" VALUE="0"><PARAM NAME="FormatString"
VALUE="(Format) 10 3300 9 9 0 0 0 1635 9 9 0 0 0 1320 9 9 0 0 0 1320 9 9 0 0 0 1 320 9 9 0 0 0 1320 9 9 0 0 0 1320 9 9 0 0 0 1320 9 9 0 0 0 1320 9 9 0 0 0 1 320 9 9 0 0 0 (Text) klant woonplaats "><PAR AM
NAME="ScrollTrack" VALUE="0"><PARAM NAME="ScrollBars" VALUE="3"><PARAM
NAME="ScrollTips" VALUE="0"><PARAM NAME="MergeCells" VALUE="0"><PARAM
NAME="MergeCompare" VALUE="0"><PARAM NAME="AutoResize" VALUE="-1"><PARAM
NAME="AutoSizeMode" VALUE="0"><PARAM NAME="AutoSearch" VALUE="0"><PARAM
NAME="AutoSearchDelay" VALUE="2"><PARAM NAME="MultiTotals" VALUE="-1"><PARAM
NAME="SubtotalPosition" VALUE="1"><PARAM NAME="OutlineBar" VALUE="0"><PARAM
NAME="OutlineCol" VALUE="0"><PARAM NAME="Ellipsis" VALUE="0"><PARAM
NAME="ExplorerBar" VALUE="0"><PARAM NAME="PicturesOver" VALUE="0"><PARAM
NAME="FillStyle" VALUE="0"><PARAM NAME="RightToLeft" VALUE="0"><PARAM
NAME="PictureType" VALUE="0"><PARAM NAME="TabBehavior" VALUE="0"><PARAM
NAME="OwnerDraw" VALUE="0"><PARAM NAME="Editable" VALUE="0"><PARAM
NAME="ShowComboButton" VALUE="1"><PARAM NAME="WordWrap" VALUE="0"><PARAM
NAME="TextStyle" VALUE="0"><PARAM NAME="TextStyleFixed" VALUE="0"><PARAM
NAME="OleDragMode" VALUE="0"><PARAM NAME="OleDropMode" VALUE="0"><PARAM
NAME="ComboSearch" VALUE="3"><PARAM NAME="AutoSizeMouse" VALUE="-1"><PARAM
NAME="FrozenRows" VALUE="0"><PARAM NAME="FrozenCols" VALUE="0"><PARAM
NAME="AllowUserFreezing" VALUE="0"><PARAM NAME="BackColorFrozen"
VALUE="0"><PARAM NAME="ForeColorFrozen" VALUE="0"><PARAM
NAME="WallPaperAlignment" VALUE="9"><PARAM NAME="AccessibleName"
VALUE=""><PARAM NAME="AccessibleDescription" VALUE=""><PARAM
NAME="AccessibleValue" VALUE=""><PARAM NAME="AccessibleRole" VALUE="24">
</object>
</p>
</body>
</html>

Jul 22 '05 #25

P: n/a
Oscar wrote:
Hi Bob,

I've been able to draft an ASP page which opens a XML doc to retrieve
the recordset. It is able to display the recordset with the response
object.
In this page there is an Active-X grid component (VSFlexgrid) which
runs at the client side and needs to be populated with the record data. I
am
able to populate the grid with any data, but I can't refer to the
recordset
object :


You are no longer asking about ASP. You will need to move this thread to a
client-side scripting newsgroup (one of the .scripting newsgroups, depending
on the language you wish to use in your client-side code will serve your
purpose - hint: using vbscript will prevent the application from working in
non-IE browsers ...). I've never used activex components due to the need for
installing them on the client machines [1] so I am unable to help with this
issue.
[1] which is only going to get harder to do in the future given the focus
being put on browser security.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #26

P: n/a
It is a combined ASP/Scripting issue since the recordset is created in ASP
and the visualisation is done both in ASP and Script. My problem is that ASP
alone works well and VBScript alone does also work well, however, ASP is not
able to pass the field value to the VBScript. So it's not only a VBScript
issue, I wish that was the case. I will also post the issue in another
group.

By the way, since the clients PC's are not any PC around the internet but
restricted to some registered users and all of them have already installed
the ActiveX, security is not a main issue.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> schreef in bericht
news:ue**************@tk2msftngp13.phx.gbl...
Oscar wrote:
Hi Bob,

I've been able to draft an ASP page which opens a XML doc to retrieve
the recordset. It is able to display the recordset with the response
object.
In this page there is an Active-X grid component (VSFlexgrid) which
runs at the client side and needs to be populated with the record data. I
am
able to populate the grid with any data, but I can't refer to the
recordset
object :


You are no longer asking about ASP. You will need to move this thread to a
client-side scripting newsgroup (one of the .scripting newsgroups,
depending on the language you wish to use in your client-side code will
serve your purpose - hint: using vbscript will prevent the application
from working in non-IE browsers ...). I've never used activex components
due to the need for installing them on the client machines [1] so I am
unable to help with this issue.
[1] which is only going to get harder to do in the future given the focus
being put on browser security.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #27

P: n/a
[comments posted inline]

"Oscar" <ok*@xs4all.nl> wrote in message
news:Ov**************@TK2MSFTNGP14.phx.gbl...
Hi Bob,

I've been able to draft an ASP page which opens a XML doc to retrieve the
recordset. It is able to display the recordset with the response object.

In this page there is an Active-X grid component (VSFlexgrid) which runs
at the client side and needs to be populated with the record data. I am
able to populate the grid with any data, but I can't refer to the
recordset object :
Of course not, you haven't created a recordset object on the client side,
there is nothing there for the client to see.

[snip]
So the client is able to see the rs object since it is able to navigate
through the records, but can't display the value of the field. Any
suggestions?
How do you figure? Every single access to the recordset object is inside of
<% %>. The only thing the client can see is the output generated on thge
server side. (See further comments inline.)
[snip]
<%
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open =Server.Mappath("db_xml.xml")
Do While not rs.EOF 'this works good
response.write (rs.Fields("naam") & " " & (rs.Fields("woonplaats")
& "<br>"))
rs.movenext
Loop

%>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
[snip]
<% rs.movefirst
Do While not rs.EOF %>

fg.additem <% rs.Fields("naam") %>

<% rs.movenext %>
<% Loop %>


[snip]

Just because this is in the client script block, does not make rs visible to
the client. The parts inside of <% %> run at the server. If you want to
create a recordset object on the client side, you need to send the XML down
to the client side, as part of the web page, like so:

[server side code]

rs.Save Response
[javascript client side code]

var rs = new ActiveXObject("ADODB.Recordset");
rs.Open(document.all.tags("XML")[0]);

Obviously if you have more than one XML element you'll have to manage them
in some way.

-Mark




Jul 22 '05 #28

This discussion thread is closed

Replies have been disabled for this discussion.