Running queries outside of Access

  • Thread starter Thread starter Jeff C
  • Start date Start date
J

Jeff C

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
 
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)
 
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?
 
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 said:
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.
 
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"
 
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
"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top