Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

executing queries from the command line

Status
Not open for further replies.

KMangan

Programmer
Aug 20, 2002
6
US
From the command line I'm trying to open an access database and execute a query that doesn't live in the database that is being opened. I don't see queries as command line parameters, but was wondering if there is a way around it??
 
Hiya,

I see a database as a collection of tables.

How can u logically 'open a database' with a query?

It's like running a function from a library of functions with a parameter - without having the development environment running that holds the library.

Sorry - not possible.

If someone kicks in and says it is - then I forewith declare my intention to train to become a plumber and make some real money.

Regards,

Darrylle

"Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
Hi,

Sorry - typo in there (lol) - should have been 'herewith' not 'forewith'.

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
I think my wording may have been confusing. I'm opening the database directly from the command line. Once the database is open I want to run a query against it. Possible?
 
I believe you can use a Command line switch to call a macro. The switch that calls the Macro is /x:MacroNameHere

"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\PhyPlant\Physical Plant 2002\PysPlant2002.mdb" /x:printReportMacro

This is what I use to open an Access database and call a macro that prints a report. You would have to use the macro to open the query or database or write a Function to do what you need to get to the query but it should be possible.

Paul



 
Hi,

Good job Paul,

Thanks 4 that - taught me to open my gob yet again. (lol)

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience."
 
I'd laugh at that but I'd probably get my foot stuck in my mouth.

Love your Signature line.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top