Author |
Topic  |
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 16:03:48
|
One of the users on my forum who I, perhaps mistakenly, gave admin privileges to archived most of the topics and posts. I didn't want them archived, but can't seem to find a way to bring them back. Is there a function to "unarchive" topics? |
Rusty Felty |
|
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 16:07:19
|
I forgot to add, my forum is mostly unmodified, I have the mod that shows number of users on, and number of users today, and it is an access database. I did see that the archived topics and replies just got moved to another table in the db, but I didn't see an easy way of moving them back to the forum and replies tables without doing it one record at a time. |
Rusty Felty |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 17:45:20
|
I'm an MCSE, not an MCDBA, but I'm fairly comfortable with it. If you want to give directions, I'm willing to try them. Thanks in advance. |
Rusty Felty |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 28 June 2004 : 18:14:46
|
Ok, you think you can create append and delete queries? Sorry, this probably should have been asked before... Also, do you use FORUM_ as a prefix? I may create the queries and post them here, if you want... |
Snitz 3.4 Readme | Like the support? Support Snitz too |
Edited by - ruirib on 28 June 2004 18:20:49 |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 28 June 2004 : 18:29:18
|
Ok, I've done it, so here it goes. You will need to create 4 queries. I'll post them in the order you need to execute them.
To create each of them, just create a new query, choose View -> SQL View from the menu and just paste the code in the SQL window. Then just run the query.
1. Restore topics from archive:
INSERT INTO FORUM_TOPICS
SELECT FORUM_A_TOPICS.*
FROM FORUM_A_TOPICS LEFT JOIN FORUM_TOPICS ON [FORUM_A_TOPICS].[TOPIC_ID]=[FORUM_TOPICS].[TOPIC_ID]
WHERE ((([FORUM_TOPICS].[TOPIC_ID]) Is Null));
2. Restore replies from archive
INSERT INTO FORUM_REPLY
SELECT FORUM_A_REPLY.*
FROM FORUM_A_REPLY;
3. Delete replies from archive table
DELETE FORUM_A_REPLY.*
FROM FORUM_A_REPLY;
4. Delete topics from archive table
DELETE FORUM_A_TOPICS.*
FROM FORUM_A_TOPICS;
Lemme know how it goes. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 18:29:38
|
the regular forum topics and replies are in FORUM_TOPICS and FORUM_REPLIES, and the archived stuff is all in FORUM_A_TOPICS and FORUM_A_REPLIES. If you feel up to making the queries, that would be a great help. I might even learn something  |
Rusty Felty |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 18:39:46
|
I'm using access 2000 and i can't find a view, sql view on the menu bar. There is a view, but the options are: Database objects Large Icons Small Icons List Details Arrange Icons-> Line Up Icons Properties (greyed out) Code (greyed out) Toolbars-> Refresh |
Rusty Felty |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 18:56:54
|
RestoreTopicsFromArchive query worked a charm. However, when I tried to run the RestoreRepliesFromArchive query, I got the follwing error message: "Microsoft Access set 0 fields to Null due to a type conversion failure, and it didn't add 6183 record(s) to the table due to key violations, 0 record(s) due to lock violations, and 0 record(s) due to validation rule violations. Do you want to run the action query anyway? To ignore the error(s) and run anyway, click yes. For an explanation of the causes of the violations, click Help."
I am going to let it sit at that dialog box and click nothing until I hear back from you . . . |
Rusty Felty |
 |
|
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 19:01:37
|
I forgot, the dialog box is headed with Microsoft Access can't append all the records in the append query. |
Rusty Felty |
Edited by - HiRez_L on 28 June 2004 19:02:15 |
 |
|
HiRez_L
Starting Member
USA
23 Posts |
|
HiRez_L
Starting Member
USA
23 Posts |
Posted - 28 June 2004 : 19:06:31
|
This link refers to the same error, but doesn't seem to apply here . . . http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q296/3/89.ASP&NoWebContent=1 |
Rusty Felty |
Edited by - HiRez_L on 28 June 2004 19:08:38 |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 28 June 2004 : 19:36:29
|
quote: Originally posted by ruirib
Ok, I've done it, so here it goes. You will need to create 4 queries. I'll post them in the order you need to execute them.
To create each of them, just create a new query, choose View -> SQL View from the menu and just paste the code in the SQL window. Then just run the query.
1. Restore topics from archive:
INSERT INTO FORUM_TOPICS
SELECT FORUM_A_TOPICS.*
FROM FORUM_A_TOPICS LEFT JOIN FORUM_TOPICS ON [FORUM_A_TOPICS].[TOPIC_ID]=[FORUM_TOPICS].[TOPIC_ID]
WHERE ((([FORUM_TOPICS].[TOPIC_ID]) Is Null));
2. Restore replies from archive
INSERT INTO FORUM_REPLY
SELECT FORUM_A_REPLY.*
FROM FORUM_A_REPLY;
3. Delete replies from archive table
DELETE FORUM_A_REPLY.*
FROM FORUM_A_REPLY;
4. Delete topics from archive table
DELETE FORUM_A_TOPICS.*
FROM FORUM_A_TOPICS;
Lemme know how it goes.
ruirib, does this keep the same TOPIC_ID and REPLY_ID for the posts? |
 |
|
Topic  |
|