Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Running queries outside of Access

Discussion in 'Information Technology' started by Jeff C, Jul 28, 2006.

  1. Jeff C

    Jeff C
    Expand Collapse
    Guest

    I am using a program called Docuanalyzer that parses together pieces
    of large reports. After creating a model which is much like an import
    specification you can export the data in a number of formats including
    an Access Database with the parsed data in it's own table. The
    program also allows you to run this process using command line
    switches so basically you are just clicking an icon on your desktop.

    Is there also a way that I can run queries that will affect the data
    from outside of Access? Possibly like using the DoCmd.RunSql?

    Thank you
     
  2. Loading...


  3. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    You can use VB script (or word or excel) to update
    or append or lookup data:

    dim dbe
    dim db

    set dbe = createobject("dao.dbengine.36")
    set db = dbe.opendatabase("mydb.mdb")
    db.Execute("MySaveQueryOrSQL")

    (david)

    "Jeff C" <jpcathotmaiDotcom@> wrote in message
    news:jn6f72lb776p2obelr78rmr4qerkjhdt7u@4ax.com...
    >I am using a program called Docuanalyzer that parses together pieces
    > of large reports. After creating a model which is much like an import
    > specification you can export the data in a number of formats including
    > an Access Database with the parsed data in it's own table. The
    > program also allows you to run this process using command line
    > switches so basically you are just clicking an icon on your desktop.
    >
    > Is there also a way that I can run queries that will affect the data
    > from outside of Access? Possibly like using the DoCmd.RunSql?
    >
    > Thank you
     
  4. Jeff C

    Jeff C
    Expand Collapse
    Guest

    Thanks for your reply: This will be very new territory for me. Any
    elaboration will be appreciated.

    Is there a good reference source on doing this anyone can point me to?


    On Sat, 27 May 2006 15:36:08 +1000, "david epsom dot com dot au"
    <david@epsomdotcomdotau> wrote:

    >You can use VB script (or word or excel) to update
    >or append or lookup data:
    >
    >dim dbe
    >dim db
    >
    >set dbe = createobject("dao.dbengine.36")
    >set db = dbe.opendatabase("mydb.mdb")
    >db.Execute("MySaveQueryOrSQL")
    >
    >(david)
     
  5. Jeff C

    Jeff C
    Expand Collapse
    Guest

    Whether from Dave or someone else, I would appreciate just a little more
    guidence, for example:

    Can I put the VB code I write into a text file, save that as a .BAT file
    which in turn will run?
    --
    Jeff C
    Live Well .. Be Happy In All You Do


    "david epsom dot com dot au" wrote:

    > You can use VB script (or word or excel) to update
    > or append or lookup data:
    >
    > dim dbe
    > dim db
    >
    > set dbe = createobject("dao.dbengine.36")
    > set db = dbe.opendatabase("mydb.mdb")
    > db.Execute("MySaveQueryOrSQL")
    >
    > (david)
    >
    > "Jeff C" <jpcathotmaiDotcom@> wrote in message
    > news:jn6f72lb776p2obelr78rmr4qerkjhdt7u@4ax.com...
    > >I am using a program called Docuanalyzer that parses together pieces
    > > of large reports. After creating a model which is much like an import
    > > specification you can export the data in a number of formats including
    > > an Access Database with the parsed data in it's own table. The
    > > program also allows you to run this process using command line
    > > switches so basically you are just clicking an icon on your desktop.
    > >
    > > Is there also a way that I can run queries that will affect the data
    > > from outside of Access? Possibly like using the DoCmd.RunSql?
    > >
    > > Thank you

    >
    >
    >
     
  6. Rick Brandt

    Rick Brandt
    Expand Collapse
    Guest

    Jeff C wrote:
    > Whether from Dave or someone else, I would appreciate just a little
    > more guidence, for example:
    >
    > Can I put the VB code I write into a text file, save that as a .BAT
    > file which in turn will run?


    If your system has the Windows Scripting Host installed and enabled then you
    would write VB script (not the same as VBA used in Access, but similar) in a
    text file and save it with a VBS file extension. That would then run much as a
    BAT file does.

    --
    Rick Brandt, Microsoft Access MVP
    Email (as appropriate) to...
    RBrandt at Hunter dot com
     
  7. Jeff C

    Jeff C
    Expand Collapse
    Guest

    Would that be like prefacing with "cscript.exe" ?

    What I have run so far is this which is saved as a .bat file

    Then this is what runs the bat file:

    "C:\Program Files\Mobius\DocuAnalyzer\Program\Autoscrp.exe" "C:\Documents
    and Settings\pky8425\Desktop\Analyze.bat"

    I guess my third step will be to place my queries as SQL statements after
    this?



    "C:\Program Files\Mobius\DocuAnalyzer\Program\Analyzer.exe"
    "C:\NeonatalBilirubin\Meditech Text Files\TOD.txt"
    "C:\NeonatalBilirubin\Meditech Text Files\TOD.mod"
    "C:\NeonatalBilirubin\Meditech Text Files\TODCleaned.txt"
    --
    Jeff C
    Live Well .. Be Happy In All You Do


    "Rick Brandt" wrote:

    > Jeff C wrote:
    > > Whether from Dave or someone else, I would appreciate just a little
    > > more guidence, for example:
    > >
    > > Can I put the VB code I write into a text file, save that as a .BAT
    > > file which in turn will run?

    >
    > If your system has the Windows Scripting Host installed and enabled then you
    > would write VB script (not the same as VBA used in Access, but similar) in a
    > text file and save it with a VBS file extension. That would then run much as a
    > BAT file does.
    >
    > --
    > Rick Brandt, Microsoft Access MVP
    > Email (as appropriate) to...
    > RBrandt at Hunter dot com
    >
    >
    >
     
  8. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    > Would that be like prefacing with "cscript.exe" ?

    Cscript for command line interface, wscript for windowed interface.

    In a batch file, you can just use "call" to call vbs scripts:

    call test.vbs

    There are many vbcript samples and tutorials on the web. Just Google
    "VBScript"

    (david)

    Note (Gareth Horton, Datawatch Corporation):
    "
    Autoscript has been "retired".

    The reason being is that there is no longer any need for autoscript in newer
    Microsoft operating systems.

    The original requirement for Autoscript came from the change in behavior
    from DOS to the DOS in Windows 3.1/95, whereby lines of a batch file would
    be executed without waiting for the return on the previous command.

    This caused a problem for Monarch (those many years ago..) for users that
    wanted to perform a routine whereby monarch would export 1 or more files,
    then read those back in in the next line, so it was paramount that the next
    line of the batch file did not execute until the last command had completed.

    Now, the behavior is back to the DOS days in Windows, so that you can just
    write a straight .bat or .cmd file (NT-style systems) and execute it with
    Monarch, safe in the knowledge that the commands will complete in order and
    after the previous command has completed
    Gareth Horton
    Datawatch Corporation
    Windows XP SP2
    Monarch Pro V8.01
    "




    "Jeff C" <JeffC@discussions.microsoft.com> wrote in message
    news:FF5FF419-56CB-486F-884A-F9AC9928685E@microsoft.com...
    > Would that be like prefacing with "cscript.exe" ?
    >
    > What I have run so far is this which is saved as a .bat file
    >
    > Then this is what runs the bat file:
    >
    > "C:\Program Files\Mobius\DocuAnalyzer\Program\Autoscrp.exe" "C:\Documents
    > and Settings\pky8425\Desktop\Analyze.bat"
    >
    > I guess my third step will be to place my queries as SQL statements after
    > this?
    >
    >
    >
    > "C:\Program Files\Mobius\DocuAnalyzer\Program\Analyzer.exe"
    > "C:\NeonatalBilirubin\Meditech Text Files\TOD.txt"
    > "C:\NeonatalBilirubin\Meditech Text Files\TOD.mod"
    > "C:\NeonatalBilirubin\Meditech Text Files\TODCleaned.txt"
    > --
    > Jeff C
    > Live Well .. Be Happy In All You Do
    >
    >
    > "Rick Brandt" wrote:
    >
    >> Jeff C wrote:
    >> > Whether from Dave or someone else, I would appreciate just a little
    >> > more guidence, for example:
    >> >
    >> > Can I put the VB code I write into a text file, save that as a .BAT
    >> > file which in turn will run?

    >>
    >> If your system has the Windows Scripting Host installed and enabled then
    >> you
    >> would write VB script (not the same as VBA used in Access, but similar)
    >> in a
    >> text file and save it with a VBS file extension. That would then run
    >> much as a
    >> BAT file does.
    >>
    >> --
    >> Rick Brandt, Microsoft Access MVP
    >> Email (as appropriate) to...
    >> RBrandt at Hunter dot com
    >>
    >>
    >>
     

Share This Page