Gossamer Forum
Home : Products : DBMan : Installation :

"Moving" a record to another DB ??? (i.e. Archive a record)

Quote Reply
"Moving" a record to another DB ??? (i.e. Archive a record)
Although I have a somewhat similar thread going on a topic like this (making a "Copy" of a record), there really is a very distinct difference so I wanted to post it seperatly so as not to confuse the issue.

Here's what I'd like to do: simply "move" a record from one database to another so that I would in affect be "archiving" the record. Then I would like to be able to a any point "move" it back to the the original db to return to an active status.

I would thingk this would be something nearly every user of a db would want to do. It seems like a logical step between adding and deleting records. Frequently, I want to in essence "hide" a record for a while so that it does not show up in searches, etc. But later I want it viewable again.

Any ideas how to go about this? Smile

Thanks!

Liverpool

Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
You never ask for the easy ones, do you? Smile

First, you would need to create another database that is identical to the first one. Make sure that you set $db_key_track = 0;.

A question before I go on. How do you want to go about archiving? Do you want to have an admin-only link on the record that says "archive this record" and do it one at a time or do you want it to be like the delete function which can do it all at once?


------------------
JPD





Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
Hey JPDeni!

Thanks for getting back to me on this. Sorry for my only delay....I finally got to take a LOOOOOOOONG overdue vacation! Sunny, tropical, coconuts, white sand....oh man, I'm ready to go back already!

OK...to answer your question, The delete way would be the nice, but I game for either. You tell me the way you think it should go....

Thanks again!
Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
Welcome back from vacation! Smile

I'll have to get back into my previous frame of mind. (Besides, it's 2am where I am and I'm just about ready to call it a night. Smile )

I will get back to you tomorrow -- today -- later.


------------------
JPD





Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
I have posted the modification for archiving records at http://www.jpdeni.com/dbman/Mods/archive.txt . Please let me know if it works for you.


------------------
JPD





Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
Hi,

I realise this is an old Thread, but I was searching through the forum for something like this and I thought I'd reply rather than start a new one.

Did you guys end up getting this to work? I tried in my DB and it semi-works :P

It creates the new record in the second DB, but the fields are all blank. The two databases are the same, I've turned off key tracking, etc...

Any ideas?

Cheers,

- Mark

------------------
Astro-Boy!!
www.zip.com.au/~astroboy/

[This message has been edited by AstroBoy (edited May 07, 2000).]
Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
Thank you for mentioning it. I had an error in my modification.

The corrected mod is at http://www.jpdeni.com/dbman/Mods/archive.txt .

The correction was in sub archive_records.

You need to change

Code:
print ARC &join_encode(%in);

to

Code:
print ARC "$line\n";

I don't know what I was thinking. Smile


------------------
JPD






Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
It worked! Smile

Thanks JPDeni! Kudos to you for everything you've done here, we'd all be lost without you! Smile

One quick note however - just in case anyone else wants this - maybe its just my cache, but the archive.txt wasn't updated for me?

Cheers, and thanks again! I'll be sure to bug you if anything else comes up Wink

- Mark

------------------
Astro-Boy!!
www.zip.com.au/~astroboy/

[This message has been edited by AstroBoy (edited May 07, 2000).]
Quote Reply
Re: "Moving" a record to another DB ??? (i.e. Archive a record) In reply to
I appreciate your mentioning it. I wonder how many other people have had a problem without saying anything.

I checked the file and it is updated. It must have been your cache.



------------------
JPD