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 Access
 database clean
 New Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

superskytten1
New Member

Denmark
94 Posts

Posted - 28 December 2012 :  04:44:09  Show Profile  Reply with Quote
how too ?? clean a database soo its absolute clean of all forums topics and members soo i can start again anyone can help thanks

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 28 December 2012 :  11:34:50  Show Profile
Why not use the database from the snitz forums zip file you downloaded?
Or download it again and use the access database from it.

http://forum.snitz.com/specs.asp

Make sure to backup your existing database first.

Support Snitz Forums
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 28 December 2012 :  12:19:50  Show Profile
It's fairly simple, Kim. You would use something like this. This will leave your Admin account in the member table and the config table completely intact. No way to know if there are any other tables you want left alone. Save this as "purgedb.asp".

IMPORTANT! There is NO confirmation! If you click ("y"), it WILL erase your database. No second chances.


<%
'###############################################################################
'##
'##			Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'##			Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output.	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 an 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:
'##
'##			Free Software Foundation, Inc.
'##			59 Temple Place, Suite 330
'##			Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'##			http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'##			manderson@snitz.com
'##
'###############################################################################
'##
'## "purgedb.asp"
'## 
'## This will PURGE your database and erase all topics!  Be careful!
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
If MemberID<>intAdminMemberID Then 
	Response.Redirect	"default.asp"
	Response.End
End If
Response.Write	"<table border=""0"" width=""100%"">" & vbNewLine & _
	"	<tr>" & vbNewLine & _
	"		<td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"		" & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"		" & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""complaintmanager.asp"">Purge Database</a><br />" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table><br />" & vbNewLine
If Request.QueryString("Confirm")<>"y" Then
	Response.Write	"<center>Purge database?  <a href=""purgedb.asp?Confirm=y"">Yes</a>   <a href=""default.asp"">No</a></center>"
	WriteFooter
	Response.End
End If	
If MemberID=intAdminMemberID Then
	Set adoxConn = CreateObject("ADOX.Catalog")
	Set adodbConn = Server.CreateObject("ADODB.Connection")
	adodbConn.Open(strConnString)
	adoxConn.activeConnection = adodbConn
	For each table in adoxConn.tables
		On Error Resume Next
		If table.name=strTablePrefix & "CONFIG_NEW" Then
			' Do Nothing
		ElseIf table.name=strMemberTablePrefix & "MEMBERS" Then
			If strDBType = "access" Then
				strSql = "DELETE * FROM " & table.name & " WHERE MEMBER_ID<>" & intAdminMemberID
			Else
				strSql = "DELETE FROM " & table.name & " WHERE MEMBER_ID<>" & intAdminMemberID
			End If
			Response.Write	strSql & "<br />"
			my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		Else
			If strDBType = "access" Then
				strSql = "DELETE * FROM " & table.name
			Else
				strSql = "DELETE FROM " & table.name
			End If
			Response.Write	strSql & "<br />"
			my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		End If
	Next
	adodbConn.Close
	adoxConn.Close
	Set adodbConn = Nothing
	Set adoxConn = Nothing
End If
Response.Write	"<br />Complete!<br />"
WriteFooter
%>



Edited by - Carefree on 28 December 2012 12:30:44
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 29 December 2012 :  00:24:07  Show Profile
Lol, leave it up to Carefree to code a custom page just to return the database to original. hehe
Good job Carefree. :)

Support Snitz Forums
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 29 December 2012 :  03:27:37  Show Profile  Visit HuwR's Homepage
I think you may need to leave a forum intact otherwise you will run into problems (errors trying to access the forum)

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 29 December 2012 :  04:27:21  Show Profile
quote:
Originally posted by Davio

Lol, leave it up to Carefree to code a custom page just to return the database to original. hehe
Good job Carefree. :)



Thanks, but it doesn't quite do that. All the tables (including all the custom ones for mods) will be intact, just the values will be cleared.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 29 December 2012 :  13:23:42  Show Profile
quote:
Originally posted by HuwR

I think you may need to leave a forum intact otherwise you will run into problems (errors trying to access the forum)



OK. Here's a version which recreates a default category, forum, and a single topic after purging the database.


<%
'###############################################################################
'##
'##			Snitz Forums 2000 v3.4.07
'##
'###############################################################################
'##
'## Copyright © 2000-06 Michael Anderson, Pierre Gorissen,
'##			Huw Reddick and Richard Kinser
'##
'## This program is free. You can redistribute and/or modify it under the
'## terms of the GNU General Public License as published by the Free Software
'## Foundation; either version 2 or (at your option) any later version.
'##
'## All copyright notices regarding Snitz Forums 2000 must remain intact in
'## the scripts and in the HTML output.	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 an 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:
'##
'##			Free Software Foundation, Inc.
'##			59 Temple Place, Suite 330
'##			Boston, MA 02111-1307
'##
'## Support can be obtained from our support forums at:
'##
'##			http://forum.snitz.com
'##
'## Correspondence and marketing questions can be sent to:
'##
'##			manderson@snitz.com
'##
'###############################################################################
'##
'## "purgedb.asp"
'## 
'## This will PURGE your database and erase all topics!  Be careful!
'##
'###############################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
If MemberID<>intAdminMemberID Then 
	Response.Redirect	"default.asp"
	Response.End
End If
Response.Write	"<table border=""0"" width=""100%"">" & vbNewLine & _
	"	<tr>" & vbNewLine & _
	"		<td width=""33%"" align=""left"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine & _
	"		" & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
	"		" & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""complaintmanager.asp"">Purge Database</a><br />" & vbNewLine & _
	"		</td>" & vbNewLine & _
	"	</tr>" & vbNewLine & _
	"</table><br />" & vbNewLine
If Request.QueryString("Confirm")<>"y" Then
	Response.Write	"<center>Purge database?  <a href=""purgedb.asp?Confirm=y"">Yes</a>   <a href=""default.asp"">No</a></center>"
	WriteFooter
	Response.End
End If	
If MemberID=intAdminMemberID Then
	Set adoxConn = CreateObject("ADOX.Catalog")
	Set adodbConn = Server.CreateObject("ADODB.Connection")
	adodbConn.Open(strConnString)
	adoxConn.activeConnection = adodbConn
	For each table in adoxConn.tables
		On Error Resume Next
		If table.name=strTablePrefix & "CONFIG_NEW" Then
			' ##	Do Nothing
		ElseIf table.name=strMemberTablePrefix & "MEMBERS" Then
			If strDBType = "access" Then
				strSql = "DELETE * FROM " & table.name & " WHERE MEMBER_ID<>" & intAdminMemberID
			Else
				strSql = "DELETE FROM " & table.name & " WHERE MEMBER_ID<>" & intAdminMemberID
			End If
			Response.Write	strSql & "<br />"
			my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		Else
			If strDBType = "access" Then
				strSql = "DELETE * FROM " & table.name
			Else
				strSql = "DELETE FROM " & table.name
			End If
			Response.Write	strSql & "<br />"
			my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		End If
	Next
	'	##	Add a default category, forum, and topic Below
		strSql = "INSERT INTO " & strTablePrefix & "CATEGORY (CAT_STATUS, CAT_NAME) VALUES (1,'Testing')"
		Response.Write	strSql & "<br />"
		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		strSql = "INSERT INTO " & strTablePrefix & "FORUM (CAT_ID, F_SUBJECT, F_DESCRIPTION, F_TOPICS, F_COUNT, F_LAST_POST, F_LAST_POST_AUTHOR, F_LAST_POST_TOPIC_ID, F_ORDER, F_DEFAULTDAYS, F_COUNT_M_POSTS)"
		strSql = strSql & "VALUES (1,'Testing Forums', 'This forum gives you a chance to become more familiar with how this product responds to different features and keeps testing in one place instead of posting tests all over. Happy Posting! ', "
		strSql = strSql & "1, 1, '" & DatetoStr(Now()) & "', " & intAdminMemberID & ", 1, 1, 30, 1)"
		Response.Write	strSql & "<br />"
		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
		strSql = "INSERT INTO " & strTablePrefix & "TOPICS (CAT_ID, FORUM_ID, T_STATUS, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_LAST_POST_AUTHOR) VALUES "
		strSql = strSql & "1, 1, 1, 'Testing', 'This is a test message.', " & intAdminMemberID & ", 1, '" & DatetoStr(Now()) & "', '" & DatetoStr(Now()) & "', " & intAdminMemberID & ", " & intAdminMemberID & ")"
		Response.Write	strSql & "<br />"
		my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords
	'	##	Add a default category, forum, and topic Above
	adodbConn.Close
	adoxConn.Close
	Set adodbConn = Nothing
	Set adoxConn = Nothing
End If
Response.Write	"<br />Complete!<br />"
WriteFooter
%>
Go to Top of Page

superskytten1
New Member

Denmark
94 Posts

Posted - 31 December 2012 :  01:27:38  Show Profile
thanks carefree davio huwr

here was a lot of choices i must say (sorry my English)

i will look at it and leave a copy of the forum

happy new year to your all

ill get back with and answer
Go to Top of Page

superskytten1
New Member

Denmark
94 Posts

Posted - 16 January 2013 :  03:53:01  Show Profile
thanks here want happens
Purge Database


DELETE * FROM FORUM_A_REPLY
DELETE * FROM FORUM_A_TOPICS
DELETE * FROM FORUM_ACTIVE_USERS
DELETE * FROM FORUM_ADS_CATEGORY
DELETE * FROM FORUM_ADS_CONTENT
DELETE * FROM FORUM_ADVERT
DELETE * FROM FORUM_ALBUM
DELETE * FROM FORUM_ALBUM_CAT
DELETE * FROM FORUM_ALBUM_CONFIG
DELETE * FROM FORUM_ALBUM_USERS
DELETE * FROM FORUM_ALLOWED_MEMBERS
DELETE * FROM FORUM_ALLOWED_USERGROUPS
DELETE * FROM FORUM_AM
DELETE * FROM FORUM_AM_DATA
DELETE * FROM FORUM_ANNOUNCE
DELETE * FROM FORUM_AVATAR
DELETE * FROM FORUM_AVATAR_CATS
DELETE * FROM FORUM_BADWORDS
DELETE * FROM FORUM_BANNED
DELETE * FROM FORUM_BANNERS
DELETE * FROM FORUM_BUDDYS
DELETE * FROM FORUM_CARD_CARDS
DELETE * FROM FORUM_CARD_CATEGORIES
DELETE * FROM FORUM_CARD_GREETINGS
DELETE * FROM FORUM_CARD_SENTCARDS
DELETE * FROM FORUM_CATEGORY
DELETE * FROM FORUM_CHARTS
DELETE * FROM FORUM_COMPLAINTS
DELETE * FROM FORUM_CONFIG_MODS
DELETE * FROM FORUM_CONFIG_PORTAL
DELETE * FROM FORUM_CUSTOM_POLICY
DELETE * FROM FORUM_CUSTOM_WLETTER
DELETE * FROM FORUM_DONATE
DELETE * FROM FORUM_EMAILFILTER
DELETE * FROM FORUM_FAQ_4ADMINS
DELETE * FROM FORUM_FAQ_4MODERATORS
DELETE * FROM FORUM_FAV_CATAGORIES
DELETE * FROM FORUM_FAV_FAVLINEITEM
DELETE * FROM FORUM_FAV_FAVOURITES
DELETE * FROM FORUM_FILECAT
DELETE * FROM FORUM_FILELISTER
DELETE * FROM FORUM_FILELISTER_CAT
DELETE * FROM FORUM_FILELISTER_CONFIG
DELETE * FROM FORUM_FILELISTER_USERS
DELETE * FROM FORUM_FILEMANAGER
DELETE * FROM FORUM_FILEREVIEWS
DELETE * FROM FORUM_FILEVERSION
DELETE * FROM FORUM_FORUM
DELETE * FROM FORUM_GAMES
DELETE * FROM FORUM_GB_OPTIONS
DELETE * FROM FORUM_GROUP_NAMES
DELETE * FROM FORUM_GROUPS
DELETE * FROM FORUM_GUESTBOOK
DELETE * FROM FORUM_IGNORE_POSTS
DELETE * FROM FORUM_IMAGE_ROTATOR
DELETE * FROM FORUM_IPLIST
DELETE * FROM FORUM_IPLOG
DELETE * FROM FORUM_MAILLIST
DELETE * FROM FORUM_MEMBERFIELDS
DELETE * FROM FORUM_MEMBERS WHERE MEMBER_ID<>1
DELETE * FROM FORUM_MEMBERS_CONFIG
DELETE * FROM FORUM_MEMBERS_PENDING
DELETE * FROM FORUM_MOD_TASKS
DELETE * FROM FORUM_MODERATOR
DELETE * FROM FORUM_MODS
DELETE * FROM FORUM_MY_CONFIG
DELETE * FROM FORUM_NAMEFILTER
DELETE * FROM FORUM_NEWS
DELETE * FROM FORUM_NEWS_CONFIG
DELETE * FROM FORUM_PAGEKEYS
DELETE * FROM FORUM_PHONEDIRECTORY_USERS
DELETE * FROM FORUM_PM
DELETE * FROM FORUM_POLL_VOTES
DELETE * FROM FORUM_POLLS
DELETE * FROM FORUM_QUOTES
DELETE * FROM FORUM_RATINGS
DELETE * FROM FORUM_READ_TOPICS
DELETE * FROM FORUM_REFERER
DELETE * FROM FORUM_REPLY
DELETE * FROM FORUM_RULES
DELETE * FROM FORUM_SEARCHLOG_KEYWORDS
DELETE * FROM FORUM_SEARCHLOG_QUERIES
DELETE * FROM FORUM_SEARCHLOG_SEARCHES
DELETE * FROM FORUM_SHOUTBOX
DELETE * FROM FORUM_SIGNUP
DELETE * FROM FORUM_SITE_CATS
DELETE * FROM FORUM_SITE_LINKS
DELETE * FROM FORUM_SITEMAP_PAGES
DELETE * FROM FORUM_SITESTAT
DELETE * FROM FORUM_SPAM
DELETE * FROM FORUM_SPAM_MAIL
DELETE * FROM FORUM_SUBSCRIPTIONS
DELETE * FROM FORUM_TETRIS
DELETE * FROM FORUM_TOPIC_RATINGS
DELETE * FROM FORUM_TOPICS
DELETE * FROM FORUM_TOTALS
DELETE * FROM FORUM_USERFIELDS
DELETE * FROM FORUM_USERFILES
DELETE * FROM FORUM_USERGROUP_MEMBERS
DELETE * FROM FORUM_USERGROUPS
DELETE * FROM FORUM_USERPHOTO
DELETE * FROM MSysAccessObjects
DELETE * FROM MSysAccessXML
DELETE * FROM MSysACEs
DELETE * FROM MSysNavPaneGroupCategories
DELETE * FROM MSysNavPaneGroups
DELETE * FROM MSysNavPaneGroupToObjects
DELETE * FROM MSysNavPaneObjectIDs
DELETE * FROM MSysObjects
DELETE * FROM MSysQueries
DELETE * FROM MSysRelationships
INSERT INTO FORUM_CATEGORY (CAT_STATUS, CAT_NAME) VALUES (1,'Testing')
INSERT INTO FORUM_FORUM (CAT_ID, F_SUBJECT, F_DESCRIPTION, F_TOPICS, F_COUNT, F_LAST_POST, F_LAST_POST_AUTHOR, F_LAST_POST_TOPIC_ID, F_ORDER, F_DEFAULTDAYS, F_COUNT_M_POSTS)VALUES (1,'Testing Forums', 'This forum gives you a chance to become more familiar with how this product responds to different features and keeps testing in one place instead of posting tests all over. Happy Posting! ', 1, 1, '20130116094947', 1, 1, 1, 30, 1)
INSERT INTO FORUM_TOPICS (CAT_ID, FORUM_ID, T_STATUS, T_SUBJECT, T_MESSAGE, T_AUTHOR, T_VIEW_COUNT, T_LAST_POST, T_DATE, T_LAST_POSTER, T_LAST_POST_AUTHOR) VALUES 1, 1, 1, 'Testing', 'This is a test message.', 1, 1, '20130116094947', '20130116094947', 1, 1)

Complete!


also this after i purge

ADODB.Field error '80020009'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/inc_header.asp, line 138
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 January 2013 :  07:55:13  Show Profile
Post a link to your "inc_header.asp" in .txt format.
Go to Top of Page

superskytten1
New Member

Denmark
94 Posts

Posted - 16 January 2013 :  08:21:59  Show Profile
ill send it too you buy mail carefree hope it ok
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 16 January 2013 :  16:15:20  Show Profile
That's fine, Kim.
Go to Top of Page

superskytten1
New Member

Denmark
94 Posts

Posted - 17 January 2013 :  01:26:19  Show Profile
thank you very must carefree i must say its working purge db
i have sent you and email again
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 17 January 2013 :  02:51:10  Show Profile
OK - try the "inc_header.asp" which I returned to you, see if it fixed the error message you received from that other mod.
Go to Top of Page

superskytten1
New Member

Denmark
94 Posts

Posted - 27 January 2013 :  06:31:58  Show Profile
thanks everybody carefree davio
i have closed this via mail too carefree
ill will take one topic at the time and erase them
BIG THANKS TOO CAREFREE FOR HIS GREAT WORK ON THIS
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 January 2013 :  10:11:33  Show Profile
If all you want to do is to delete topics, you should see the multi-topic delete mod I wrote a year ago.

Edited by - Carefree on 27 January 2013 10:12:02
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07