473,666 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple command line prompt to call MS Access Module?

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

Mar 23 '06 #1
2 37521
Yes, sort of.

You can call a macro in the command line when you open Access. The macro
could have the RunCode command which will run a VBA function.

Example:
"<path>\msacces s.exe" "<path>\MyDatab ase.mdb" /x MacroName

You can also use an AutoExec macro to automatically run code when you open
the database or place code in the Open event of your startup form to run the
procedures you need.

Another option is to use the /cmd switch on the command line. You can then
use the Command() function in code to extract this information to react as
desired.

--
Wayne Morgan
MS Access MVP
<to********@gma il.com> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.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

Mar 23 '06 #2
<to********@gma il.com> wrote in message
news:11******** **************@ i39g2000cwa.goo glegroups.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(strComm and, "DoExtract" , vbBinaryCompare ) = 0 Then
' Code to do the extract
Else
' Wrong start code - so quit
Application.Qui t
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.


Mar 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
9287
by: Steve | last post by:
Is there anyone with experience using the Winzip command line add-in? I can't get it to create the zip file with a space in the file name. Using: RetValue = Shell("C:\winzip\wzzip.exe C:\MyFolder\My ZipFile.Zip C:\MyOtherFolder\MyFile.mdb") What is the syntax when you want a space in the zipfile file name?
4
11444
by: Greg B | last post by:
Well since getopt() doesn't seem to be compatible with Windows, and the free implementation of it for Windows that I found still had some annoying restrictions, I thought I'd whip up a simple parser myself. Just wanted to see if anyone could provide me with some constructive criticism :) any feedback would be greatly appreciated ----------------------------------------------------------------------------- #include "stdio.h" #include...
3
2273
by: Billy Cormic | last post by:
Hello, I would like to write a windows application that can get the IP address of the computer the appliation is installed on. Then the program should ftp a file to another computer. I have no idea how to do this. Does anyone have any ideas about how create and run commands using a command line prompt in vb.net. Thanks, Billy
2
1129
by: CP11 | last post by:
Newbie here. I am used to using vbscript but trying vb.net in vs2003. I am trying to add a button click event, like this: Dim LaunchApp As Integer LaunchApp = Shell("""c:\program files\myapp\bin\newapp.exe"" /cmdline http://myapps/file.asp /logon") AppActivate(LaunchApp)
6
6816
by: Armel Asselin | last post by:
Hello, I'm searching for a simple command line tool to manipulate XML files. The idea would be commands such as that: xmanip-tool set /document/xpath/@name="value" remove //wrong-nodes add /document/node=\<hello\ < in.xml out.xml so, it would simple add/remove/change commands (either as arguments or input script file), a bit of xpath and the usual Unix parameters (-o output,-f
9
2487
by: Endless Story | last post by:
My last version of Python was 2.4, running smoothly on XP with path c: \Python24 - no need even to include this path in PATH; everything worked as it's supposed to at the command line. Just installed Python 2.5, after uninstalling 2.4 (and also 2.3 which had lingered). Now if I open a shell in Windows Python is not available! Here are the symptoms: - If I open a shell using "Command line here" with XP Powertools, then enter "python"...
3
4571
by: Tom Baxter | last post by:
I just set up VS 2008 B2 and did a simple command line compile from the VS command prompt. I received this warning: warning CS1668: Invalid search path 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. ' When I checked, sure enough, the "lib" directory is not present'. Perhaps I
5
1843
by: waltbrad | last post by:
Hi folks. I'm learning Python from the Mark Lutz Book, Programming Python 3rd edition. He seems to be able to invoke the Python interpreter from any command line prompt. C:\temp>python C:\PP3rdEd\examples>python
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8869
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.