View Full Version : Multiple summary export commands
aceinthecorner2005
August 6th, 2008, 03:33 PM
Visual Basic seems interesting but I have no experience with it so I am trying to automate using .bat files.
My model has about a dozen different filters and each has a corresponding summary. I am trying to export my table and all my summaries in a batch file. I can make it export the main table and the first summary on the list but no more.
Is there a way via a project, or loop, or data filter, etc that would allow me to export multiple summaries using command lines?
Please halp! Much appreciated!
Data Kruncher
August 6th, 2008, 04:27 PM
Hi Ace,
If you've got some of the exports working properly, you're 90% of the way there. You know that your model is working just fine.
You definitely want to go the Project route so that you define a sequence of standard, repeatable exports. The first will be the Table, likely without a filter, and then followed by each of the Summaries.
In your batch file you'll just need to specify the project with /prj:, then use /pxall to export all of the defined project exports. They'll run in the sequence you built in the Project Exports dialog, so move them up or down as necessary to get the order you want. Right-click on the export name to Move Up or Move Down as applicable.
One thing that you didn't mention but causes some frustration for the somewhat inexperienced is that you cannot append summaries to existing exports if the headings are different. That may or may not play a role in what you're trying to do.
HTH,
Kruncher
aceinthecorner2005
August 12th, 2008, 12:29 PM
Thanks I will have to experiment with projects as I am a total noob when it comes to utilizing them ... they frighten me at the moment (espeically when using them with append commands). But if I can figure them out then it sounds like it may work better than building a model for each individual summary.
As to the column headers I am trying to be very uniform with the this database and that should not be an issue for me.
One thing though ... I am sure it's discussed somehwhere in this forum but I just put a password on my .mdb. Each time Monarch performs an external lookup to one of the .mdb, or appends a table I need to incorporate a password command into my .bat script, does anyone know off hand what is the command line for accomplishing this?
Data Kruncher
August 12th, 2008, 01:22 PM
Spend a few minutes experimenting building project exports using the Classic.prn training file, then be sure to save, close, and re-open a new project file to see how it behaves. I'm sure that you'll get the hang of it in no time.
As to supplying the password for the database, use the /pwd switch, as in /pwd:ace if "ace" was the password.
There's an optional name parameter for the pwd switch, so if you've changed the default name for the database from maindb to say mydb, you'd use this syntax: /pwd:mydb=ace
OK?
aceinthecorner2005
August 12th, 2008, 03:20 PM
Got it, thank you Kruncher! With project exports is one able to append existing tables?
Data Kruncher
August 12th, 2008, 04:10 PM
Yes, you can append to an existing Access table using project exports.
Glad to hear that you're making progress.
aceinthecorner2005
August 12th, 2008, 04:31 PM
Got it, thank you Kruncher except the .bat does not run completely. It is still prompting me for a pw!
Thanks again
Data Kruncher
August 12th, 2008, 05:00 PM
I believe that I've confused the issue and perhaps have inadvertantly mislead you somewhat.
While there is a /pwd command line parameter available, according to the online help it does not apply to exporting to databases; instead it relates to automatically supplying a password to databases which would be used as input sources.
As I understand it, you will not be able to automatically supply a password to your database when exporting.
aceinthecorner2005
August 12th, 2008, 09:25 PM
Hmm. Well it would be both I think, right? I mean if you put a password on you .mdb and the Monarch model is setup to do an external lookup from one of the tables it prompts for a pw. My .bat is getting hung up there.
I suppose it would be a separate issue / command again when attempting to append, but I can't get that far as the batch always fails.
I think rather that I will remove the pw option from the .mdb and find another way to protect the .mdb so as not to have to deal with this. ;)
Now back to the drawing board as to how to append multiple summaries to separate tables via a project export command.:eek:
RalphB
August 13th, 2008, 08:55 AM
You can do what I do when I need to export to a password db. I export to a temp access db that is not password protected and then through access, export it into the password protected one using access queries and macros or script and then deleting contents the temp tables if necessary, but do not delete the whole db as that will contain your queries and macros.
aceinthecorner2005
August 20th, 2008, 01:54 PM
Ah good thoughts, thank you all !
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.