How to run a "query" form a MS-DOS Batch

A

ali

How to run a "query" form a MS-DOS Batch ?

I have a query in MS Access (q_update_Table)

I'd like to know

1) how to execute a query in MS Access from MS-DOS
2) or other ways to run the query without actually opening the MS Access File
 
W

Wayne-I-M

May be wrong about this ??

Don't think its possible - although you can via word, excel, etc

Why not just just run your dos-batch to open the DB Hidden then run whatever
you want to do then exit. That wouldn't take much work and it should work
better than trying to run an office prog outside of office.

Although as I said someone else may have a method

Good luck
 
R

Rui

you can call the access database with commandline options.
the /x macro may be the most useful option for you.

i.e mydatabase /x macro_q_update_table

where macro_q_update_table could be a run query to your q_update_Table.

Hope this helps
 
G

Guest

Would you consider using a VBS script file instead? Or
a script file called from a batch file? To call a script
file from a batch file you use cscript.exe. In a script file
you have lines like this

dim dbe as object
dim db as object
set dbe = createobject("dao.dbengine.36")
set db = dbe.opendatabase("mydatabase")
db.execute "my sql or query name"

air code- I haven't done it recently.

(david)
 
T

Tony Toews [MVP]

Wayne-I-M said:
May be wrong about this ??

Don't think its possible - although you can via word, excel, etc

You'd still have to execute Word, Excel, etc anyhow.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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

Top