Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 FYI - Members Timing Out
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  21:04:44  Show Profile
yes, still getting the timeout.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 27 December 2002 :  21:20:00  Show Profile
does eliminating the maxpages stops timing out. or Assign a numeric value to maxpages and see if it passes thru that statement. for example:
maxpages = 500
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  21:28:44  Show Profile
yes it does. I know that the maxpages should be 676 so I changed:

maxpages = cLng(rs.pagecount)

to:

maxpages = 676 'cLng(rs.pagecount)

and as you can see, members.asp doesn't timeout anymore.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 27 December 2002 :  21:28:56  Show Profile  Send ruirib a Yahoo! Message
One alternative would be to count the records with an explicit sql statement just for that purpose, and then use it coupled with strPageSize to get the number of pages. Should avoid the timeouts, hopefully.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 27 December 2002 :  21:32:14  Show Profile
It could be that clng is causing the timed out error. As wew now know the statement which is causing the error. let us try without clng

maxpages = (rs.pagecount)
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  21:32:29  Show Profile
I've been doing some research and have found a couple of different ways to handle it, this page shows 3 different ways:

www.adopenstatic.com/experiments/recordsetpaging.asp
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 27 December 2002 :  21:39:17  Show Profile
quote:
Originally posted by ruirib

One alternative would be to count the records with an explicit sql statement just for that purpose, and then use it coupled with strPageSize to get the number of pages. Should avoid the timeouts, hopefully.



Richard tried the rs.recordcount with strPageSize and it timed out
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  21:42:06  Show Profile
quote:
Originally posted by GauravBhabu

It could be that clng is causing the timed out error. As wew now know the statement which is causing the error. let us try without clng

maxpages = (rs.pagecount)


I did, it still timed out.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  21:43:15  Show Profile
quote:
Originally posted by GauravBhabu

quote:
Originally posted by ruirib

One alternative would be to count the records with an explicit sql statement just for that purpose, and then use it coupled with strPageSize to get the number of pages. Should avoid the timeouts, hopefully.



Richard tried the rs.recordcount with strPageSize and it timed out

I think what ruirib meant was to use the same method that we use for MySQL to get the total # of pages.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 27 December 2002 :  21:47:28  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by GauravBhabu

quote:
Originally posted by ruirib

One alternative would be to count the records with an explicit sql statement just for that purpose, and then use it coupled with strPageSize to get the number of pages. Should avoid the timeouts, hopefully.



Richard tried the rs.recordcount with strPageSize and it timed out


I was not suggesting using rs.recordcount. I meant something like:


strSql = "SELECT COUNT(MEMBER_ID) AS TotalMembers FROM FORUM_MEMBERS WHERE...."

set rsCount= my_conn.Execute(strSql)

intTotalMembers = rsCount("TotalMembers")
...

Then use intTotalMembers with strPageSize. Anyway at least one of the methods Richard found looks interesting...


P.S.: Richard was faster than I was. And yes, I could just have said to do it the way it is done with MySQL .


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 27 December 2002 21:49:30
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 27 December 2002 :  21:53:37  Show Profile
It seems that accessing the pagecount property is causing the error. I don't know why it would happen but doing some tests might help to determine the cause of error.

What comes to my mind is using
clng(strPageSize) instead of strPageSize

Checking the result of
Response.write "PageCount " & rs.PageCount


Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  22:02:52  Show Profile
it shows the pagecount but only after the script times out.

I added the following:

Response.Write "Pagecount = " & rs.pagecount
Response.End

right above this line:

maxpages = 676 'cLng(rs.pagecount)

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 27 December 2002 :  22:18:47  Show Profile
Just an effort to determine the cause of error, you may please check if we can access pagesize or other properties correctly

rs.pagesize = clng(strPageSize)
Response.write "RecCount : " & rs.recordcount & "<BR>"
Response.write "PageSize: " & rs.PageSize & "<BR>"
Response.write "PageCount: " & rs.PageCount & "<BR>"
maxpages = (rs.pagecount)
rs.absolutepage = mypage '**
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  22:24:39  Show Profile
ok, here is what I have changed, and it seems to work without any errors:

I replaced this:

	set rs = Server.CreateObject("ADODB.Recordset")
	rs.cachesize = strPageSize
	rs.open strSql & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic
		If not (rs.EOF or rs.BOF) then
			rs.movefirst
			rs.pagesize = strPageSize
			rs.absolutepage = mypage '**
			maxpages = cLng(rs.pagecount)
			arrMemberData = rs.GetRows(strPageSize)
			iMemberCount = UBound(arrMemberData, 2)
		else
			iMemberCount = ""
		end if
	rs.Close
	set rs = nothing

with this:
	'## Forum_SQL - Get the total pagecount 
	strSql1 = "SELECT COUNT(MEMBER_ID) AS PAGECOUNT "
 
	set rsCount = my_Conn.Execute(strSql1 & strSql2 & strSql3)
	iPageTotal = rsCount(0).value
	rsCount.close
	set rsCount = nothing
 
	if iPageTotal > 0 then
		maxpages = (iPageTotal \ strPageSize )
		if iPageTotal mod strPageSize <> 0 then
			maxpages = maxpages + 1
		end if
	else
		iPageTotal = 0
		maxpages = 0
	end if 
 
	if iPageTotal > 0 then
		set rs = Server.CreateObject("ADODB.Recordset")
		rs.cachesize = strPageSize
		rs.open strSql & strSql2 & strSql3 & strSql4, my_Conn, adOpenStatic, adLockReadOnly, adCmdText
			rs.pagesize = strPageSize
			rs.absolutepage = mypage '**
			arrMemberData = rs.GetRows(strPageSize)
			iMemberCount = UBound(arrMemberData, 2)
		rs.Close
		set rs = nothing
	else
		iMemberCount = ""
	end if
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 27 December 2002 :  22:29:31  Show Profile
quote:
Originally posted by GauravBhabu

Just an effort to determine the cause of error, you may please check if we can access pagesize or other properties correctly

rs.pagesize = clng(strPageSize)
Response.write "RecCount : " & rs.recordcount & "<BR>"
Response.write "PageSize: " & rs.PageSize & "<BR>"
Response.write "PageCount: " & rs.PageCount & "<BR>"
maxpages = (rs.pagecount)
rs.absolutepage = mypage '**


It shows the RecCount, but not the PageSize or PageCount, you can test it here on this site. Just let me know after you have seen it so I can change the code in the file.
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07