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: MOD Implementation
 How to delete things in DBs from INSIDE the forum.
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Hasheba
New Member

USA
97 Posts

Posted - 12 January 2003 :  17:02:07  Show Profile  Visit Hasheba's Homepage  Send Hasheba an AOL message
Is there a way to delete things from the snitz_forums_2000.mdb from inside the forum? The reason I ask is becasue I have two instances of strPMLimit and strPMStatus in the table config_new and I have no program to delete these from..

Is there a code to delete these two things?

Thanks!

-Jeff
http://www.leo-land.net

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 12 January 2003 :  17:08:51  Show Profile
Try putting this in the alternative mod setup page.

[ALTER]
CONFIG_NEW
DROP#strPMLimit####
DROP#strPMStatus####
[END]

EDIT - If you don't have that page just create a new file called dbs_drop.asp or something and run it from the normal mod setup page.

Edited by - Hamlin on 12 January 2003 17:10:46
Go to Top of Page

Hasheba
New Member

USA
97 Posts

Posted - 12 January 2003 :  17:12:57  Show Profile  Visit Hasheba's Homepage  Send Hasheba an AOL message
Will this drop BOTH instances or just the one? I guess I'll try it.

Thanks

-Jeff
http://www.leo-land.net
Go to Top of Page

Hasheba
New Member

USA
97 Posts

Posted - 12 January 2003 :  17:14:56  Show Profile  Visit Hasheba's Homepage  Send Hasheba an AOL message
Okay I get this..

Dropping Column...
ALTER TABLE FORUM_CONFIG_NEW DROP COLUMN STRPMLIMIT
ALTER TABLE FORUM_CONFIG_NEW DROP COLUMN STRPMLIMIT
-2147217900 | [Microsoft][ODBC Microsoft Access Driver] There is no field named 'STRPMLIMIT' in table 'FORUM_CONFIG_NEW'.
Dropping Column...
ALTER TABLE FORUM_CONFIG_NEW DROP COLUMN STRPMSTATUS
ALTER TABLE FORUM_CONFIG_NEW DROP COLUMN STRPMSTATUS
-2147217900 | [Microsoft][ODBC Microsoft Access Driver] There is no field named 'STRPMSTATUS' in table 'FORUM_CONFIG_NEW'.

The things in bold are errors.. Why do I get these?

I was told by a memeber of this forum that I had two istances of those two things STRPMLIMIT and STRPMSTATUS so I know they are there..

Very odd

-Jeff
http://www.leo-land.net

Edited by - Hasheba on 12 January 2003 17:16:58
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 12 January 2003 :  17:18:49  Show Profile
quote:
Originally posted by Hasheba

Will this drop BOTH instances or just the one? I guess I'll try it.

Thanks


Opps I did not think of that , as it did not work I guess it does not matter, but if it had of worked as I expected then I think both instances would have been deleted..

That should of worked I think, I'll have another look at it...
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 13 January 2003 :  07:27:51  Show Profile
Hamlin, the code is correct as for as I can see.

Jeff, how does the member know this? Does he have access to your database? Or was he reffering to your forum variables?

If you go to your admin options --> Forum Variables, you will see a list of variables the forum uses to keep the admin cofiguration. If you see more than 2 of the variables you mentioned, then that is probably what he was reffering to.

Is there some error you are getting, why you want to remove the duplicates? There are a few ways to try and remove duplicate forum variables.

Support Snitz Forums
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 13 January 2003 :  09:41:59  Show Profile
I realised last night the code is incorrect, as far as its intended purpose goes, there is no column in the config_new table called strPMStatus or strPMLimit, they are only values that table, in the C_VARIABLES column I think…

Edited by - Hamlin on 13 January 2003 09:42:28
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 13 January 2003 :  12:37:39  Show Profile
quote:
Originally posted by Hamlin

I realised last night the code is incorrect, as far as its intended purpose goes, there is no column in the config_new table called strPMStatus or strPMLimit, they are only values that table, in the C_VARIABLES column I think…

You are quite right Hamlin. You cannot remove any config values from the forum. Would have to remove it manually.

The MOD Setup script doesn't have support the DELETE sql command, which is needed to delete a specific value from the table. The sql query would be something like:
DELETE FROM FORUM_CONFIG_NEW WHERE C_VARIABLE = 'strPMStatus'
DELETE FROM FORUM_CONFIG_NEW WHERE C_VARIABLE = 'strPMLimit'
Can't do it from the forum.

Support Snitz Forums
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 13 January 2003 :  13:02:56  Show Profile
Saying that Davio I put this in my alternative mod forum page..


[DELETE]
CONFIG_NEW
C_VARIABLE = 'strPMStatus'
[END]


And it said...

quote:


Database Update


Updating Forum Values..
DELETE FROM FORUM_CONFIG_NEW WHERE C_VARIABLE = 'strPMStatus'

Value(s) updated successfully



The only thing I noticed is that you have to do it one value at a time so


[DELETE]
CONFIG_NEW
C_VARIABLE = 'strPMLimit'
C_VARIABLE = 'strPMStatus'
[END]


Did not seem to work.

EDIT - missing some forum code

Edited by - Hamlin on 13 January 2003 13:04:39
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 13 January 2003 :  13:08:04  Show Profile
Did you try with OR?
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 13 January 2003 :  13:15:29  Show Profile
What?? The alternative mod setup supports the DELETE command?
*looks at the files*

Well, look at that. Both mod setup files support the DELETE command. I never knew this.

Yeah, you will have to delete config values one by one. But I have been wrong 2 times in this topic so I figure you have every right to doubt me. lol

Support Snitz Forums

Edited by - Davio on 13 January 2003 13:17:10
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 13 January 2003 :  13:19:07  Show Profile
quote:
Originally posted by GauravBhabu

Did you try with OR?



Nope I did not, and yes you were correct, using OR did indeed delete both . I should have seen that one

So in answer to the original question I believe doing something like this will delete the repeats, and then add the values back in. I have tested this on my local forum and it worked fine..

[DELETE]
CONFIG_NEW
C_VARIABLE = 'strPMLimit' OR C_VARIABLE ='strPMStatus'
[END]
[INSERT]
CONFIG_NEW
(C_VARIABLE,C_VALUE)#('strPMLimit','20')
(C_VARIABLE,C_VALUE)#('strPMStatus','1')
[END]


You would need to replace the red values with the values you are currently using.

Got there in the end
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 13 January 2003 :  13:21:20  Show Profile
quote:
Originally posted by Davio

Yeah, you will have to delete config values one by one. But I have been wrong 2 times in this topic so I figure you have every right to doubt me. lol



Thats a hat trick!
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 13 January 2003 :  13:29:19  Show Profile
quote:
Originally posted by Davio

What?? The alternative mod setup supports the DELETE command?
*looks at the files*

Well, look at that. Both mod setup files support the DELETE command. I never knew this.

Yeah, you will have to delete config values one by one. But I have been wrong 2 times in this topic so I figure you have every right to doubt me. lol



I remember there was a discussion on using the DELETE. It could do great damage if not used correctly.
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.24 seconds. Powered By: Snitz Forums 2000 Version 3.4.07