session("var")= rs.getRows()

B

bajopalabra

hi
session("myVar") = rs.getRows( )
don't work when number of records
is greater than 10

does anybody know WHY ???

is it a Session object limitation ???

thanks
 
B

Bob Barrows [MVP]

bajopalabra said:
hi
session("myVar") = rs.getRows( )
don't work when number of records
is greater than 10

does anybody know WHY ???

is it a Session object limitation ???
What does "don't work" mean? Error message? Nothing happens? Try to describe
the symptoms of your problem without using the words "does not work".
 
B

bajopalabra

sure, thanks
(excuse me about my english)
all the session variable are cleaned
that is, session is lost

only 1 user can get session("aVar")= rs.getRows( )
the rest, will get a single session("id")= rs("user_id)

thanks again
 
B

Bob Barrows [MVP]

Is this something you can reliably reproduce? IE, can you modify the
getrows() statement so it only uses 9 records in the resulting array
session("aVar")= rs.getRows(9)
and have the problem go away?

And then change it to
session("aVar")= rs.getRows(10)
to cause the problem to reappear?

Bob Barrows
 
B

Bob Barrows [MVP]

Oh! And if you have "on error resume next" in your code, comment it out
until you figure out what the real problem is.
 
B

bajopalabra

i have no "on error" statement

i simply touch the table in the database
to get the number of records i desire
and then i execute the asp file

i test with 1 , 2 , .... thru 9
and, when i insert the 10th row in the table :
- the asp file get 10 rows
- But the "session array" is empty
- 2 other "single session vars" previously created
are empty too ...

now, i delete a row :
- the asp file get 9 rows
- the "session array" has correct values
- 2 other "single session vars" hace correct values

each row has 55 bytes

i tried ( with 10 or more rows ) :

dim aux( 20, 20 )
aux= rs.getRows ( )
session("arrayVar")= aux

but the effect is the same
 
B

Bob Barrows [MVP]

Sorry, I've never seen anything like this. Here is my attempt to reproduce
the symptoms. It works fine for me. How about you?

<%
if len(Request.Form("rows"))=0 then
session("test1") = "Here I am"
session("test2") = "I am here too"
end if
dim rs, i
set rs=createobject("adodb.recordset")
rs.Fields.append "id",3
rs.Fields.append "col1",200,50
rs.Fields.append "col2",200,50
rs.Open
for i = 1 to 15
rs.AddNew array("id","col1","col2"), _
array(i,"this is some test data ","this is some more test data")
next
i=Request.Form("rows")
if len(i)=0 then i = 5
'Response.Write rs.RecordCount
rs.MoveFirst
session("data") = rs.GetRows(i)
rs.Close

%>
<html><body><form method="post">
Enter rows to store:&nbsp;<input name="rows" type="text" value="<%=i%>"><BR>
Session("test1"): <%=Session("test1")%><BR>
Session("test2"): <%=Session("test2")%><BR>
Session("data"): <BR>
Contains <%=ubound(session("data"),2) + 1%> records<BR>
First record: <%=Session("data")(0,0) & " - " & Session("data")(1,0)%><BR>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</form></body></html>
 
B

bajopalabra

ok, i suspect we have something
try changing

session("data") = rs.GetRows( i )
for
session("data") = rs.GetRows( )

I WAS ommiting the "rec count" paramenter of GetRows
should it be that , right ?

i go to find out now
why existing session var are cleaned
and then i post the result

thanks you much,
Bob

--
atte, Hernán

Bob Barrows said:
Sorry, I've never seen anything like this. Here is my attempt to reproduce
the symptoms. It works fine for me. How about you?

<%
if len(Request.Form("rows"))=0 then
session("test1") = "Here I am"
session("test2") = "I am here too"
end if
dim rs, i
set rs=createobject("adodb.recordset")
rs.Fields.append "id",3
rs.Fields.append "col1",200,50
rs.Fields.append "col2",200,50
rs.Open
for i = 1 to 15
rs.AddNew array("id","col1","col2"), _
array(i,"this is some test data ","this is some more test data")
next
i=Request.Form("rows")
if len(i)=0 then i = 5
'Response.Write rs.RecordCount
rs.MoveFirst
session("data") = rs.GetRows(i)
rs.Close

%>
<html><body><form method="post">
Enter rows to store:&nbsp;<input name="rows" type="text"
 
B

Bob Barrows [MVP]

bajopalabra said:
ok, i suspect we have something
try changing

session("data") = rs.GetRows( i )
for
session("data") = rs.GetRows( )
OK, I made the change. Still no problem:
<%
if len(Request.Form("rows"))=0 then
session("test1") = "Here I am"
session("test2") = "I am here too"
end if
dim rs, i,j
i=Request.Form("rows")
if len(i)=0 then i = 5
set rs=createobject("adodb.recordset")
rs.Fields.append "id",3
rs.Fields.append "col1",200,50
rs.Fields.append "col2",200,50
rs.Open
for j = 1 to i
rs.AddNew array("id","col1","col2"), _
array(j,"this is some test data ","this is some more test data")
next
'Response.Write rs.RecordCount
rs.MoveFirst
session("data") = rs.GetRows()
rs.Close

%>
<html><body><form method="post">
Enter rows to store:&nbsp;<input name="rows" type="text" value="<%=i%>"><BR>
Session("test1"): <%=Session("test1")%><BR>
Session("test2"): <%=Session("test2")%><BR>
Session("data"): <BR>
Contains <%=ubound(session("data"),2) + 1%> records<BR>
First record: <%=Session("data")(0,0) & " - " & Session("data")(1,0)%><BR>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</form></body></html>
 
R

Roland Hall

in message
: bajopalabra wrote:
: > hi
: > session("myVar") = rs.getRows( )
: > don't work when number of records
: > is greater than 10
: >
: > does anybody know WHY ???
: >
: > is it a Session object limitation ???
: >
: What does "don't work" mean?

bad gramma'
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top