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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: Database: MS SQL Server
 Forum Count Timeout
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

fetch
Starting Member

46 Posts

Posted - 06 May 2005 :  18:03:40  Show Profile  Visit fetch's Homepage
I'm getting this error after the SQL move when I try to update the forum counts:

Microsoft OLE DB Provider for SQL Server error '80040e31'

Timeout expired

/4rum/forum/admin_count.asp, line 324

The error is based on the ASP scripting timeout I believe, so I set the server to allow up to 200 seconds but still no dice. Is there any way to speed this up or only run it on certain categories?

http://www.mhsaa.org/4rum/forum/

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 06 May 2005 :  18:27:13  Show Profile  Send ruirib a Yahoo! Message
That's not ASP timeout, it's a DB connection timeout. What is the contents of that line# 324?

Do you have indexes on your database?


Snitz 3.4 Readme | Like the support? Support Snitz too

Edited by - ruirib on 06 May 2005 18:27:41
Go to Top of Page

fetch
Starting Member

46 Posts

Posted - 09 May 2005 :  23:15:09  Show Profile  Visit fetch's Homepage
'## Forum_SQL - Get last_post and last_post_author for Forum
		strSql = "SELECT T_LAST_POST, T_LAST_POST_AUTHOR "
		strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
		strSql = strSql & " WHERE FORUM_ID = " & rs("FORUM_ID") & " "
		strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_STATUS <= 1"
		strSql = strSql & " ORDER BY T_LAST_POST DESC"

		set rs2 = my_Conn.Execute (strSql)
			
		if not (rs2.eof or rs2.bof) then
			strLast_Post = rs2("T_LAST_POST")
			strLast_Post_Author = rs2("T_LAST_POST_AUTHOR")
		else
			strLast_Post = ""
			strLast_Post_Author = ""
		end if
			
		rs2.Close
		set rs2 = nothing
	
		strSql = "UPDATE " & strTablePrefix & "FORUM "
		strSql = strSql & " SET F_COUNT = " & intF_COUNT
		strSql = strSql & ",  F_TOPICS = " & intF_TOPICS
		strSql = strSql & ",  F_A_COUNT = " & intF_A_COUNT
		strSql = strSql & ",  F_A_TOPICS = " & intF_A_TOPICS
		if strLast_Post <> "" then 
			strSql = strSql & ", F_LAST_POST = '" & strLast_Post & "' "
			if strLast_Post_Author <> "" then 
				strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author
			end if
		end if
		strSql = strSql & " WHERE FORUM_ID = " & rs("FORUM_ID")
	
		my_conn.execute(strSql)

http://www.mhsaa.org/4rum/forum/
Go to Top of Page

fetch
Starting Member

46 Posts

Posted - 09 May 2005 :  23:18:23  Show Profile  Visit fetch's Homepage
That's the code - that line is near the end. I don't have any indexes yet since it was just imported from Access; what should I be indexing?

http://www.mhsaa.org/4rum/forum/
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 10 May 2005 :  04:58:23  Show Profile  Send ruirib a Yahoo! Message
You should definitely index. What you should do is, at least, create the indexes created by the Snitz installation script. The SQL is in the inc_create_forum_mssql.asp file. Just look for index creation statements and create indexes on the same tables / columns as created by the Snitz database.
Alternatively or additionally, you can let SQL Server profiler run on your database, for a reasonable amount of time, and then follow its suggestion on index creation.


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

fetch
Starting Member

46 Posts

Posted - 10 May 2005 :  17:06:20  Show Profile  Visit fetch's Homepage
I tried indexing but I got this error on most if not all the tables:

"The selected table has no unique single column index on a column that does not allow NULLS."

Here's the SQL I managed to dig out of the file you suggested:

CREATE INDEX FORUM_CATEGORY_CAT_ID ON FORUM_CATEGORY(CAT_ID)
CREATE INDEX FORUM_CATEGORY_CAT_STATUS ON FORUM_CATEGORY(CAT_STATUS)
CREATE INDEX FORUM_CAT_ID ON FORUM_FORUM(CAT_ID)
CREATE INDEX FORUM_F_CAT ON FORUM_FORUM(CAT_ID)
CREATE INDEX FORUM_FORUM_ID ON FORUM_FORUM(FORUM_ID)
CREATE INDEX MEMBERS_MEMBER_ID ON FORUM_MEMBERS(MEMBER_ID)
CREATE INDEX FORUM_MODERATOR_FORUM_ID ON FORUM_MODERATOR(FORUM_ID)
CREATE INDEX FORUM_MODERATORS_MEMBER_ID ON FORUM_MODERATOR(MEMBER_ID)
CREATE INDEX FORUM_REPLY_R_AUTHOR ON FORUM_REPLY(R_AUTHOR)
CREATE INDEX FORUM_REPLY_CATFORTOP_ID ON FORUM_REPLY(CAT_ID, FORUM_ID, TOPIC_ID)
CREATE INDEX FORUM_FORUM_ID ON FORUM_REPLY(FORUM_ID)
CREATE INDEX FORUM_REPLY_ID ON FORUM_REPLY(REPLY_ID)
CREATE INDEX FORUM_REPLY_TOPIC_ID ON FORUM_REPLY(TOPIC_ID)
CREATE INDEX FORUM_TOPICS_CAT_ID_FORUM_ID ON FORUM_TOPICS(CAT_ID, FORUM_ID)
CREATE INDEX FORUM_TOPICS_T_AUTHOR ON FORUM_TOPICS(T_AUTHOR)
CREATE INDEX FORUM_TOPICS_CAT_ID ON FORUM_TOPICS(CAT_ID)
CREATE INDEX FORUM_FORUM_ID ON FORUM_TOPICS(FORUM_ID)
CREATE INDEX FORUM_TOPICS_TOPIC_ID ON FORUM_TOPICS(TOPIC_ID)
CREATE INDEX FORUM_TOPICS_CAT_FOR_TOP ON FORUM_TOPICS(CAT_ID, FORUM_ID, TOPIC_ID)

So the next question I guess is - which columns on these tables should I be using as an index? Chances are I have to go in and set some not to allow NULL but I'm not sure which at this point.

http://www.mhsaa.org/4rum/forum/
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 May 2005 :  07:40:01  Show Profile  Send ruirib a Yahoo! Message
Do the tables have primary keys? They should have. Have you created them?


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

fetch
Starting Member

46 Posts

Posted - 11 May 2005 :  14:44:16  Show Profile  Visit fetch's Homepage
Ah, no. I was under the impression that "identity" was the same as primary key. D'oh. Which column(s) should I be using as the key?

http://www.mhsaa.org/4rum/forum/
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 May 2005 :  16:27:41  Show Profile  Send ruirib a Yahoo! Message
Check the inc_create_forum_mssql.asp again. I don't like some of the keys, but that's a good start.


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

fetch
Starting Member

46 Posts

Posted - 11 May 2005 :  23:05:01  Show Profile  Visit fetch's Homepage
strSql = "ALTER TABLE " & strTablePrefix & "REPLY WITH NOCHECK ADD "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC63 DEFAULT 0 FOR CAT_ID, "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC64 DEFAULT 0 FOR FORUM_ID, "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC65 DEFAULT 0 FOR TOPIC_ID, "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC66 DEFAULT 0 FOR R_MAIL, "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC67 DEFAULT 0 FOR R_AUTHOR, "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC68 DEFAULT '' FOR R_DATE, "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC69 DEFAULT '000.000.000.000' FOR R_IP, "
	strSql = strSql & "CONSTRAINT " & strTablePrefix & "SnitzC70 PRIMARY KEY  NONCLUSTERED "
	strSql = strSql & "(CAT_ID,	FORUM_ID, TOPIC_ID,	REPLY_ID )"


In that snippet, is the primary key for that table defined as

CAT_ID, FORUM_ID, TOPIC_ID, REPLY_ID

? I'm not the best with ASP, so it's a little difficult reading that code (plus I've never set a Primary Key programatically before). Thanks


http://www.mhsaa.org/4rum/forum/
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 May 2005 :  04:54:02  Show Profile  Send ruirib a Yahoo! Message
Yes, the primary key there is on CAT_ID, FORUM_ID, TOPIC_ID and REPLY_ID. I would skip that and just put it in REPLY_ID, and then add foreign key constraints to each of the other 3 fields.


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

fetch
Starting Member

46 Posts

Posted - 28 May 2005 :  14:39:32  Show Profile  Visit fetch's Homepage
Ok, I've added primary keys for all the major tables and done a full text index on them. When I run the update counts script though, I get this error on step 2:

Microsoft OLE DB Provider for SQL Server error '80004005'

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

/4rum/forum/admin_count.asp, line 198

Here's my code for the admin_count page:


<%
'#################################################################################
'## Copyright (C) 2000-01 Michael Anderson and Pierre Gorissen
'## 
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to 
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'## 
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'## 
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
'## 
'## Support can be obtained from support forums at:
'## http://forum.snitz.com 
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'## 
'## or
'## 
'## Snitz Communications 
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<% If Session(strCookieURL & "Approval") = "15916941253" Then %> 
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE file="inc_top_short.asp" -->
<%
intStep = Request.QueryString("Step")
if intStep = "" or IsNull(intStep) then
	intStep = 1
else
	intStep = CInt(intStep)
end if

if intStep < 4 then 
	Response.write "<meta http-equiv=""Refresh"" content=""1; URL=admin_count.asp?Step=" & intStep + 1 & """>"
else
	Response.write "<meta http-equiv='Refresh' content='60; URL=admin_home.asp'>"
end if
%>

<table border="0" width="100%">
  <tr>
    <td width="33%" align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
    <img src="<%= strImageUrl %>icon_folder_open_topic.gif" height=15 width=15 border="0"> Update Forum Counts<br>
    </font></td>
  </tr>
</table>
<br>
<table align=center border=0>
  <tr>
    <td align=center colspan=2><p><b><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">Updating Counts Step <%= intStep %> of 4 </font></b><br>
     </p></td>
  </tr>
<%
Server.ScriptTimeout = 6000

set rs = Server.CreateObject("ADODB.Recordset")
set rs1 = Server.CreateObject("ADODB.Recordset")

if intStep = 1 then 
	Response.Write "  <tr>" & vbNewline
	Response.Write "    <td align=right valign=top><font face='" &strDefaultFontFace & "'>Topics:</font></td>" & vbNewline
	Response.Write "    <td valign=top><font face='" &strDefaultFontFace & "'>"

	'## Forum_SQL - Get contents of the Forum table related to counting
	strSql = "SELECT FORUM_ID, F_TOPICS FROM " & strTablePrefix & "FORUM WHERE F_TYPE <> 1 "
	
	rs.Open strSql, my_Conn
	rs.MoveFirst
	i = 0 

	do until rs.EOF
		i = i + 1

		'## Forum_SQL - count total number of topics in each forum in Topics table
		strSql = "SELECT count(FORUM_ID) AS cnt "
		strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
		strSql = strSql & " WHERE FORUM_ID = " & rs("FORUM_ID")
		strSql = strSql & " AND T_STATUS <= 1 "

		rs1.Open strSql, my_Conn

		if rs1.EOF or rs1.BOF then
			intF_TOPICS = 0
		else
			intF_TOPICS = rs1("cnt")
		end if

		rs1.close

		'## Forum_SQL - count total number of topics in each forum in A_Topics table
		strSql = "SELECT count(FORUM_ID) AS cnt "
		strSql = strSql & " FROM " & strTablePrefix & "A_TOPICS "
		strSql = strSql & " WHERE FORUM_ID = " & rs("FORUM_ID")
		strSql = strSql & " AND T_STATUS <= 1 "

		rs1.Open strSql, my_Conn

		if rs1.EOF or rs1.BOF then
			intF_A_TOPICS = 0
		else
			intF_A_TOPICS = rs1("cnt")
		end if

		rs1.close
	
		strSql = "UPDATE " & strTablePrefix & "FORUM "
		strSql = strSql & " SET F_TOPICS = " & intF_TOPICS
		strSql = strSql & " , F_A_TOPICS = " & intF_A_TOPICS
		strSql = strSql & " WHERE FORUM_ID = " & rs("FORUM_ID")
	
		my_conn.execute(strSql)
	
		rs.MoveNext
		Response.Write "."
		if i = 80 then 
			Response.Write "    <br>" & vbNewline
			i = 0
		end if
	loop
	rs.Close

	Response.Write "    </font></td>" & vbNewline
	Response.Write "  </tr>" & vbNewline
elseif intStep = 2 then 
	Response.Write "  <tr>" & vbNewline
	Response.Write "    <td align=right valign=top><font face='" &strDefaultFontFace & "'>Topic Replies:</font></td>" & vbNewline
	Response.Write "    <td valign=top><font face='" & strDefaultFontFace & "'>"

	'## Forum_SQL
	strSql = "SELECT TOPIC_ID, T_REPLIES FROM " & strTablePrefix & "TOPICS"
	strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.T_STATUS <= 1"

	rs.Open strSql, my_Conn
	i = 0 

	do until rs.EOF
		i = i + 1

		'## Forum_SQL - count total number of replies in Topics table
		strSql = "SELECT count(REPLY_ID) AS cnt "
		strSql = strSql & " FROM " & strTablePrefix & "REPLY "
		strSql = strSql & " WHERE TOPIC_ID = " & rs("TOPIC_ID")
		strSql = strSql & " AND R_STATUS <= 1 "

		rs1.Open strSql, my_Conn
		if rs1.EOF or rs1.BOF or (rs1("cnt") = 0) then
			intT_REPLIES = 0
		
			set rs2 = Server.CreateObject("ADODB.Recordset")

			'## Forum_SQL - Get post_date and author from Topic
			strSql = "SELECT T_AUTHOR, T_DATE "
			strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
			strSql = strSql & " WHERE TOPIC_ID = " & rs("TOPIC_ID") & " "
			strSql = strSql & " AND T_STATUS <= 1"
				
			rs2.Open strSql, my_Conn
			
			if not(rs2.eof or rs2.bof) then
				strLast_Post = rs2("T_DATE")
				strLast_Post_Author = rs2("T_AUTHOR")
			else
				strLast_Post = ""
				strLast_Post_Author = ""
			end if
				
			rs2.Close
			set rs2 = nothing
		
		else
			intT_REPLIES = rs1("cnt")
		
			'## Forum_SQL - Get last_post and last_post_author for Topic
			strSql = "SELECT R_DATE, R_AUTHOR "
			strSql = strSql & " FROM " & strTablePrefix & "REPLY "
			strSql = strSql & " WHERE TOPIC_ID = " & rs("TOPIC_ID") & " "
			strSql = strSql & " AND R_STATUS <= 1"
			strSql = strSql & " ORDER BY R_DATE DESC"
				
			set rs3 = my_Conn.Execute (strSql)
			
			if not(rs3.eof or rs3.bof) then
				rs3.movefirst
				strLast_Post = rs3("R_DATE")
				strLast_Post_Author = rs3("R_AUTHOR")
			else
				strLast_Post = ""
				strLast_Post_Author = ""
			end if
	
			rs3.close
			set rs3 = nothing
		end if
	
		strSql = "UPDATE " & strTablePrefix & "TOPICS "
		strSql = strSql & " SET T_REPLIES = " & intT_REPLIES
		if strLast_Post <> "" then 
			strSql = strSql & ", T_LAST_POST = '" & strLast_Post & "'"
			if strLast_Post_Author <> "" then 
				strSql = strSql & ", T_LAST_POST_AUTHOR = " & strLast_Post_Author 
			end if
		end if
		strSql = strSql & " WHERE TOPIC_ID = " & rs("TOPIC_ID")
	
		my_conn.execute(strSql)
		
		rs1.Close
		rs.MoveNext
		Response.Write "."
		if i = 80 then 
			Response.Write "    <br>" & vbNewline
			i = 0
		end if
	loop
	rs.Close

	Response.Write "    </font></td>" & vbNewline
	Response.Write "  </tr>" & vbNewline

elseif intStep = 3 then 

	Response.Write "  <tr>" & vbNewline
	Response.Write "    <td align=right valign=top><font face='" & strDefaultFontFace & "'>Forum Replies:</font></td>" & vbNewline
	Response.Write "    <td valign=top><font face='" &strDefaultFontFace & "'>"

	'## Forum_SQL - Get values from Forum table needed to count replies
	strSql = "SELECT FORUM_ID, F_COUNT FROM " & strTablePrefix & "FORUM WHERE F_TYPE <> 1 "

	rs.Open strSql, my_Conn, 2, 2

	do until rs.EOF

		'## Forum_SQL - Count total number of Replies
		strSql = "SELECT Sum(" & strTablePrefix & "TOPICS.T_REPLIES) AS SumOfT_REPLIES, Count(" & strTablePrefix & "TOPICS.T_REPLIES) AS cnt "
		strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
		strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.FORUM_ID = " & rs("FORUM_ID")
		strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_STATUS <= 1"
	
		rs1.Open strSql, my_Conn
	
		if rs1.EOF or rs1.BOF then
			intF_COUNT = 0
			intF_TOPICS = 0
		else
			intF_COUNT = rs1("cnt") + rs1("SumOfT_REPLIES")
			intF_TOPICS = rs1("cnt") 
		end if
		if IsNull(intF_COUNT) then intF_COUNT = 0 
		if IsNull(intF_TOPICS) then intF_TOPICS = 0 

		rs1.close

		'## Forum_SQL - Count total number of Archived Replies
		strSql = "SELECT Sum(" & strTablePrefix & "A_TOPICS.T_REPLIES) AS SumOfT_REPLIES, Count(" & strTablePrefix & "A_TOPICS.T_REPLIES) AS cnt "
		strSql = strSql & " FROM " & strTablePrefix & "A_TOPICS "
		strSql = strSql & " WHERE " & strTablePrefix & "A_TOPICS.FORUM_ID = " & rs("FORUM_ID")
		strSql = strSql & " AND " & strTablePrefix & "A_TOPICS.T_STATUS <= 1"
	
		rs1.Open strSql, my_Conn
	
		if rs1.EOF or rs1.BOF then
			intF_A_COUNT = 0
			intF_A_TOPICS = 0
		else
			intF_A_COUNT = rs1("cnt") + rs1("SumOfT_REPLIES")
			intF_A_TOPICS = rs1("cnt") 
		end if
		if IsNull(intF_A_COUNT) then intF_A_COUNT = 0 
		if IsNull(intF_A_TOPICS) then intF_A_TOPICS = 0 

		rs1.close
	
		'## Forum_SQL - Get last_post and last_post_author for Forum
		strSql = "SELECT T_LAST_POST, T_LAST_POST_AUTHOR "
		strSql = strSql & " FROM " & strTablePrefix & "TOPICS "
		strSql = strSql & " WHERE FORUM_ID = " & rs("FORUM_ID") & " "
		strSql = strSql & " AND " & strTablePrefix & "TOPICS.T_STATUS <= 1"
		strSql = strSql & " ORDER BY T_LAST_POST DESC"

		set rs2 = my_Conn.Execute (strSql)
			
		if not (rs2.eof or rs2.bof) then
			strLast_Post = rs2("T_LAST_POST")
			strLast_Post_Author = rs2("T_LAST_POST_AUTHOR")
		else
			strLast_Post = ""
			strLast_Post_Author = ""
		end if
			
		rs2.Close
		set rs2 = nothing
	
		strSql = "UPDATE " & strTablePrefix & "FORUM "
		strSql = strSql & " SET F_COUNT = " & intF_COUNT
		strSql = strSql & ",  F_TOPICS = " & intF_TOPICS
		strSql = strSql & ",  F_A_COUNT = " & intF_A_COUNT
		strSql = strSql & ",  F_A_TOPICS = " & intF_A_TOPICS
		if strLast_Post <> "" then 
			strSql = strSql & ", F_LAST_POST = '" & strLast_Post & "' "
			if strLast_Post_Author <> "" then 
				strSql = strSql & ", F_LAST_POST_AUTHOR = " & strLast_Post_Author
			end if
		end if
		strSql = strSql & " WHERE FORUM_ID = " & rs("FORUM_ID")
	
		my_conn.execute(strSql)

		rs.MoveNext
		Response.Write "."
		if i = 80 then 
			Response.Write "    <br>" & vbNewline
			i = 0
		end if	
	loop
	rs.Close

	Response.Write "    </font></td>" & vbNewline
	Response.Write "  </tr>" & vbNewline

elseif intStep = 4 then 
	Response.Write "  <tr>" & vbNewline
	Response.Write "    <td align=right valign=top><font face='" &strDefaultFontFace & "'>Totals:</font></td>" & vbNewline
	Response.Write "    <td valign=top><font face='" &strDefaultFontFace & "'>"
	
	'## Forum_SQL - Total of Topics
	strSql = "SELECT Sum(" & strTablePrefix & "FORUM.F_TOPICS) "
	strSql = strSql & " AS SumOfF_TOPICS "
	strSql = strSql & ", Sum(" & strTablePrefix & "FORUM.F_A_TOPICS) "
	strSql = strSql & " AS SumOfF_A_TOPICS "
	strSql = strSql & " FROM " & strTablePrefix & "FORUM WHERE F_TYPE <> 1 "

	rs.Open strSql, my_Conn

	Response.Write "Total Topics: " & RS("SumOfF_TOPICS") & "<br>" & vbNewline
	Response.Write "Archived Topics: " & RS("SumOfF_A_TOPICS") & "<br>" & vbNewline

	'## Forum_SQL - Write total Topics to Totals table
	strSql = "UPDATE " & strTablePrefix & "TOTALS "
	strSql = strSql & " SET T_COUNT = " & rs("SumOfF_TOPICS")
	strSql = strSql & " , T_A_COUNT = " & rs("SumOfF_A_TOPICS")

	rs.Close

	my_Conn.Execute strSql

	'## Forum_SQL - Total all the replies for each topic
	strSql = "SELECT Sum(" & strTablePrefix & "FORUM.F_COUNT) "
	strSql = strSql & " AS SumOfF_COUNT "
	strSql = strSql & ", Sum(" & strTablePrefix & "FORUM.F_A_COUNT) "
	strSql = strSql & " AS SumOfF_A_COUNT "
	strSql = strSql & " FROM " & strTablePrefix & "FORUM WHERE F_TYPE <> 1 "

	set rs = my_Conn.Execute (strSql)
	'rs.Open strSql, my_Conn

	if rs("SumOfF_COUNT") <> "" then
		Response.Write "Total Posts: " & RS("SumOfF_COUNT") & "<br>" & vbNewline
		strSumOfF_COUNT = rs("SumOfF_COUNT")
	else
		Response.Write "Total Posts: 0<br>" & vbNewline
		strSumOfF_COUNT = "0"
	end if
	if rs("SumOfF_A_COUNT") <> "" then
		Response.Write "Total Archived Posts: " & RS("SumOfF_A_COUNT") & "<br>" & vbNewline
		strSumOfF_A_COUNT = rs("SumOfF_A_COUNT")
	else
		Response.Write "Total Posts: 0<br>" & vbNewline
		strSumOfF_A_COUNT = "0"
	end if

	'## Forum_SQL - Write total replies to the Totals table
	strSql = "UPDATE " & strTablePrefix & "TOTALS "
	strSql = strSql & " SET P_COUNT = " & strSumOfF_COUNT
	strSql = strSql & " , P_A_COUNT = " & strSumOfF_A_COUNT

	rs.Close

	my_Conn.Execute strSql

	'## Forum_SQL - Total number of users
	strSql = "SELECT Count(MEMBER_ID) "
	strSql = strSql & " AS CountOf "
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"

	rs.Open strSql, my_Conn

	Response.Write "Registered Users: " & RS("Countof") & "<br>" & vbNewline

	'## Forum_SQL - Write total number of users to Totals table
	strSql = " UPDATE " & strTablePrefix & "TOTALS "
	strSql = strSql & " SET U_COUNT = " & cint(RS("Countof"))

	rs.Close

	my_Conn.Execute strSql

	Response.Write "    </font></td>" & vbNewline
	Response.Write "  </tr>" & vbNewline

	Response.Write "  <tr>" & vbNewline
	Response.Write "    <td align=center colspan=2> <br>" & vbNewline
	Response.Write "    <b><font face='" & strDefaultFontFace & "' size=" & strHeaderFontSize & ">Count Update Complete</font></b></font></td>" & vbNewline
	Response.Write "  </tr>" & vbNewline
	


	Response.Write "  <tr>" & vbNewline
	Response.Write "    <td align=center colspan=2> <br>" & vbNewline
	Response.Write "    <a href=""admin_home.asp""><font face='" & strDefaultFontFace & "' size=" & strDefaultFontSize & " color='" & strDefaultFontColor & "'>Back to Admin Home</font></a></td>" & vbNewline
	Response.Write "  </tr>" & vbNewline


end if

set rs = nothing
set rs1 = nothing

response.write "</table>"

<MM:BeginLock translatorClass="MM_SSI" type="ssi_comment" orig="%3C!--#INCLUDE file=%22inc_footer_short.asp%22 --%3E" fileRef="inc_footer_short.asp" depFiles="file:///C|/Documents and Settings/Administrator/My Documents/mhsaa/4rum/forum/inc_footer_short.asp"><%
'#################################################################################
'## Copyright (C) 2000-01 Michael Anderson and Pierre Gorissen
'## 
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to 
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'## 
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'## 
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
'## 
'## Support can be obtained from support forums at:
'## http://forum.snitz.com 
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'## 
'## or
'## 
'## Snitz Communications 
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
    <p><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="JavaScript:onClick= window.close()">Close Window</A></font></p>
    </font>
    </center></div>
    </td>
  </tr>
</table>

</BODY>
</HTML>
<%
my_Conn.Close
set my_Conn = nothing
%>
<MM:EndLock>

Else
	scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
	Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
End IF
%>


line 198 is bolded. I'm not sure how it can generate that error since the SQL string defined in config.asp obviously works, else the whole forum would be down!

http://www.mhsaa.org/4rum/forum/
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 28 May 2005 :  19:06:07  Show Profile  Send ruirib a Yahoo! Message
Please do not post the code like that. Use a link to a text file.

Regarding the error, it's a weird one. Does it always occur on that line?


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

Podge
Support Moderator

Ireland
3775 Posts

Posted - 28 May 2005 :  19:42:16  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
If you are on Windows 2003 and I think you are, it could be the port limit issue. Have you installed SP1 or made the required registry changes?

By default on W2003 you are limited to 5000 (- 1024) ports by default. Everytime you loop through a recordset you open up another port which goes into a wait state for 4 minutes (by default as far as I can remember) until that connection is used again. If you are archiving lots of posts or updating the forum counts you can use up these ports quite quickly.


Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 28 May 2005 19:43:39
Go to Top of Page

fetch
Starting Member

46 Posts

Posted - 28 May 2005 :  20:24:43  Show Profile  Visit fetch's Homepage
Sorry about the code - didn't realize it was so much until it posted.

Answers:

Yes, it always occurs on that line AFAIK.

I AM on a 2003 server - is there any way around the port limit issue?

http://www.mhsaa.org/4rum/forum/
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 29 May 2005 :  06:33:26  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Yes there is, its corrected on SP1. If you don't plan to install SP1 there is a registry change you can make.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
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.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07