4 Replies Latest reply: May 15, 2014 9:58 AM by tradewinds _ RSS

    Appending to MS Access from a command line

    tradewinds _

      I don't know a thing about OLE Automation, so I revert to simple batch script files.  I'm trying to create a command line script that will append to an .mdb file, or any file for that matter.  So far I have this,

      monarch /rpt:"mercury as30 ecapture2001 0073197.txt" /mod:"mercury as30modelsdaily summary report.mod" /exp:"d:daily_summary_report.mdb"

       

      This works fine at creating a new file, but I want to append this file and I hope someone can tell me the way via command line.

       

      By the way, I tried using the Project feature and I was wondering how do you save multiple input files (quickly and easily) to a project file.

       

      Thanks,

      Jeff

       

      [size="1"][ January 26, 2004, 12:04 PM: Message edited by: tradewinds ][/size]

        • Appending to MS Access from a command line
          cardealers _

          Jeff,

           

          I have been told the append feature is a version 7 feature.

           

           

          Cardealers

          • Appending to MS Access from a command line
            tradewinds _

            Thank you 'cardealers'.  I did not state in my previous posting, but I am using Monarch Pro v7. 

             

            I can append to an MS Access file from an open table in Monarch, but I cannot find the syntax for running from a command line.  I found enough instructions to figure out how to export to a new MS Access file, but not append.  I found references to the /set parameter, but either that is not the correct parameter or I'm not using the correct syntax.  I tried

            monarch /rpt:"mercury as30 ecapture2001 0734001.txt" /mod:"mercury as30modelsdaily summary report.mod" /exp:"d:dsummary.mdb" /set:fileoption=append /set:table="daily charge summary" /set:tableoption=append

             

            When I run this command, the set parameters are ignored and the file is overwritten anyhow.

             

            I saved an Export Project and ran it from the command line and it launched Monarch, opened the report, opened the model, but did not export the file.

            monarch /prj:"d:dsummary.prj"

             

            I tried the same command with the /exp: parameter included and that overwrote the MS Access file.

             

            Help.

             

            [size="1"][ January 26, 2004, 12:03 PM: Message edited by: tradewinds ][/size]

            • Appending to MS Access from a command line
              Grant Perkins

              Hi tradewinds,

               

              I spent a while playing with this and getting nowhere until I spotted a less then obvious error in my command line! 

               

              If you set up your model and define the Project Export within it then save the model and then save the Project (different to project export) you should be able to run the command to run Monarch, kick into the project and then specify what you want to you export - /pxall for example - to give you what you require. You need to set up most of the parameters in the Export Project.

               

              Check the help for "Using Monarch Command lines".

               

              The format for a command would be along the lines of:

               

              monarch /prj:"PATH TO .PRJ FILE" /px:[export name]

               

              or

               

              monarch /prj:"PATH TO .PRJ FILE" /pxall

               

              The /px???????   section makes use of the Project Export definition(s). (I think this is the bit you are missing?)

               

              The /prj    section defines, via the Project Definition File,  the source file and model to use.

               

              The help outlines some of the other options for flexibility of reporting.

               

              I hope this helps. My 'perfect' command line failed the first 20 or so times I tried it. The I checked it properly and realised that it did not provide the path information that I was reading from it. Fixed my error and it worked fine!

               

              Just one of those moments that remind me that what should be relatively simple can sometimes be a little too easy !

               

              If this doesn't help let me know and I will see if I can spot any other issues to consider.

               

              Grant

               

               

              Originally posted by tradewinds:

              Thank you 'cardealers'.  I did not state in my previous posting, but I am using Monarch Pro v7. 

               

              I can append to an MS Access file from an open table in Monarch, but I cannot find the syntax for running from a command line.  I found enough instructions to figure out how to export to a new MS Access file, but not append.  I found references to the /set parameter, but either that is not the correct parameter or I'm not using the correct syntax.  I tried

              monarch /rpt:"mercury as30 ecapture2001 0734001.txt" /mod:"mercury as30modelsdaily summary report.mod" /exp:"d:dsummary.mdb" /set:fileoption=append /set:table="daily charge summary" /set:tableoption=append

               

              When I run this command, the set parameters are ignored and the file is overwritten anyhow.

               

              I saved an Export Project and ran it from the command line and it launched Monarch, opened the report, opened the model, but did not export the file.

              monarch /prj:"d:dsummary.prj"

               

              I tried the same command with the /exp: parameter included and that overwrote the MS Access file.

               

              Help. /b[/quote]

              • Appending to MS Access from a command line
                tradewinds _

                Thank you, thank you, thank you:)  I overlooked the /px or /pxall parameter before.