Is there any way to run multiple SQL commands in Access 2003

R

Rod

I want to be able to run multiple SQL commands in Access 2003 without having
to write a bunch of VB code or the cumbersome stored proceedures method using
stored proceedures in a upsized Access database.

Every other database software I have used can do this easily but Microsoft
Access seems to what you to be a programmer to do this.

Grumble
 
A

Albert D.Kallal

Just build your queries, an save them. (you have to save them some
where!!!!)

To run them, just click on one after another....

If clicking is too much exercise, and too hard, then create a small code
routines. After all, if a person can figure out how to write and need to run
"several" sql statements, then I can't imagine this is any more difficult
then write a few lines of code?

Simply create a code module, and go

currentdb.Execute "query1"
currnetdb.Execute "query2"
etc....

I mean, you can also type the raw sql from the debug window, such as:

currentdb.execute "update tblCustomers set NewYear = true"

or, you can execute the name of saved query:

currentdb.Execute "query1"

You *can* type the sql into your code module, such as:

dim s as string

s = "update tblCustomers set NewYear = True"
currentdb.Execute s

s = "bala abla abal"
currentdb.Execute s

The above is no more work then typing in a bunch of statements into a text
file. And, often those "other" systems you talked about do need a "go"
command, or something else between each statement. The above is not any more
work. As mentioned, the prefer approach is to save the queries, and then use
code to run them as per the first example.....
 
A

aaron.kempf

I use a concept called chapters

so that i write a query; and then i dont need to DO ANYTHING ot get it
to run.

I just loop through all my queries looking for queries named QF01, and
thern QF02, etc

pretty straight; i wish i could share more of my code; but it's more
trouble than it's worth

-Aaron
 

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