<to********@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Hi All:
I was wondering if there's a simple way to call a MS Access Module
through either
Command Prompt
MS Script
any other way...
Thanks for the response.
I am trying to extract some data out of a table in Access on a
scheduled basis, I figured the simplest way is to do a simple module,
have some command to extract the information, then schedule it.
thx again
tony
If the machine which is going to run the scheduled task has Access on it,
then you could call something like this:
"C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE"
"C:\MyExtractor.mdb" /cmd "DoExtract"
The database MyExtractor.mdb has all of the functions in a module together
with an AutoExec macro. The macro has a single step of RunCode where the
function is =DoExtract()
Public Function DoExtract()
Dim strCommand As String
strCommand = Command()
If StrComp(strCommand, "DoExtract", vbBinaryCompare) = 0 Then
' Code to do the extract
Else
' Wrong start code - so quit
Application.Quit
End If
End Function
The code could do whatever extraction was needed and then shut itself down.
The disadvantage of this is you need Access installed (and scheduled tasks
are often run from a server where this is not the case) and also the fact
that Access is a big program to start if all you need to do is extract a bit
of data.
You could create a vbs file which does it all without needing Access at all.
This has the advantage that you only need notepad to write it, but VBScript
suffers from being weakly-typed and offers quite limited error handling.
However, if you wrote it carefully, you would be OK. If you wanted the
advantage of a small program loading together with error handling you would
need something like Visual Basic to create an exe file.