Author |
|
PhilC Newbie
Joined: March 18 2004 Location: United Kingdom
Online Status: Offline Posts: 39
|
Posted: April 15 2005 at 07:58 | IP Logged
|
|
|
Hi,
I have a range of about 200 macros that I need to export and additionally, I need to export about 15 control center settings that go with these macros. Is there a simpler option to do this other than one by one?
Many thanks
Phil
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: April 15 2005 at 14:14 | IP Logged
|
|
|
Phil,
Yes, there is an easier way but it's a little advanced. I'll go through it below.
I don't know what your range of macros is based upon so below will just export all of your macros. If you can narrow it down to something like all macros that start with the letters 'PR' then we can make some adjustments, but in the meantime we'll just export them all so you can see whats involved.
Go the menu Reports->SQL Query. I window will open. Type the following SQL statement:
select * from macroheader
and press "Do-it". A new window will open showing all of the data in the macroheader table. Next go to the menu File->Export. Change the "Save as type" dropdown to "SQL". Next, set the "File name" field to "macroheader.sql". THIS IS VERY IMPORTANT! If the filename is not "macroheader.sql" then the SQL will not be correct. Next, just press "Save".
This will create an export file of all the macro headers. Next we just need to create a file of the macro details but first, we need to fix this file.
Open the "macroheader.sql" file in notepad. At the very top you see a sql statement for creating the macroheader table. It will look like the below:
CREATE TABLE macroheader (
id char(25),
key_desc char(25),
menu_shortcut float,
grammar_include float,
list_include float);
Delete all of these lines up to the first INSERT statement. Save the file.
To get the macro details, we'll follow the same procedure above except the SQL statement will be:
select * from macrodetail
Export the file as "macrodetail.sql". Edit the file and remove the CREATE TABLE statement. You can save the file as is or copy the remaining contents and paste them to the end of the macroheader.sql file.
Exporting the Control Center may be a little trickier. It depends on what you're wanting to export...macro buttons, IR buttons, etc. If you're just exporting macro buttons (for the macros that you've already exported) then you'll just need to export the buttons and tabs. If you're exporting IR, you'll need to export from the EQUIP and IR tables as well. I'll just assume you're exporting macro buttons from a single tab that I'll call MACROS. Below is the SQL:
select * from cctabs where id = 'MACROS'
This will export the info the "MACROS" tab. Save the file as "cctabs.sql" and delete the CREATE TABLE statement.
To get the buttons use this SQL:
select * from ccbuttons where tab_id = 'MACROS'
Save the file as "ccbuttons.sql" and delete the CREATE TABLE statement.
You should start to see the pattern that is developing. If you can give me more details on what needs to be exported, I can fine tune the SQL for you .
Dave.
|
Back to Top |
|
|
PhilC Newbie
Joined: March 18 2004 Location: United Kingdom
Online Status: Offline Posts: 39
|
Posted: April 16 2005 at 09:50 | IP Logged
|
|
|
Thanks Dave, I understand what to do.
I have successfully exported my sql but I have one question.
As the sql contains 'INSERT INTO' commands will I not have to perform a 'delete from macroheader' command in order to import the macros?
Many thanks
Phil
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: April 16 2005 at 14:02 | IP Logged
|
|
|
Phil,
If you were to reimport the macros into the same database, then yes, you would need to first delete from the macroheader and macrodetail tables.
If you had previously exported all macros, then the appropriate SQL statements would be:
delete * from macrodetail;
delete * from macroheader;
The above statements could be entered and executed from the "Direct SQL" window under the Maintenance menu.
Just be sure the you've properly exported before doing any deletes like this as it's irreversible. You may want to just make a backup copy of your database before doing this .
Dave.
|
Back to Top |
|
|
dmoreno Newbie
Joined: February 15 2002 Location: United States
Online Status: Offline Posts: 31
|
Posted: November 30 2005 at 22:19 | IP Logged
|
|
|
Dave, I thought I was going to have to purchase PH again. I was using my laptop for powerhome. Nothing fancy, just things to make life easier around the house. It used less power and it was small. Well my was broken into thanksgiving, and the only thing that was taken was.... you guessed it, the laptop. Lucky for me I made a backup right?! NOPE!!! It was corrupt telling me my trial period was over. Well I had yet an older copy. 009.db, remember that one? well, finally got it upgraded to current version. Just didn't want to have to reprogram the darn thing. THANK GOD for the forum. I was able to export all my macros. I guess the EQUIP table was corrupt, cuz there wasn't anything there. That wasn't too bad. Now I keep 2 backups of my database. One on CD, and the other on backup harddrive.
You know, It's true, You don't know what ya got until its gone. I missed my PH, and am now progamming a little security into my HA. Don
Edited by dmoreno
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 02 2005 at 22:48 | IP Logged
|
|
|
Don,
That sucks!! It's just plain rotten when some coward has to break in and take your property, especially during the holidays.
Nahhh, you wouldnt have to purchase again. You'd of just needed to send me your new registration code from your install and I'd send you the unlock code. Other people have had similar problems with computer crashes and such.
I know what you mean about backups. Im paranoid as hell and keep all of my irreplaceable data (like PowerHome) on a USB drive that I take with me everywhere. I'll then back that up occasionally to either DVD or CD-R. Ive even gone so far as to store a copy at my parents house in case of a catastrophic lost at my own.
Sorry to hear about all your troubles though. I cant even remember version 009. That really is dated. I don't know how you even got it updated .
In any event, let me know if you still have any problems and I'll do my best to help you out.
Take care,
Dave.
|
Back to Top |
|
|