Run batch queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to know if MS Access can run several queries at the same time. For
example:
--
DELETE FROM CUSTOMERS WHERE IDCustomer <=30;
DELETE FROM ORDERS WHERE IDOrder>=150;
--
The query runs OK on SQL Server, but in MS Access give me error message. Is
there a way to create one script with multiple queries?

Thanks
Mauricio
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can't put multiple statements in a QueryDef. In ADO and ODBCDirect
you can put multiple SELECT statements in a command, but I'm not sure
about multiple action (DELETE, UPDATE, INSERT) statements.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQkMZhIechKqOuFEgEQI7ewCffLJ0Hh2SkgnY5+Tup6LWn8E9kVQAnj97
qqQjXCDpDZvWBbA0wwJWFc/+
=JW/e
-----END PGP SIGNATURE-----
 
That's too bad
With SQL Server I can do it.
But with MS Access I have to put all the queries into an array(string), then
loop the array and execute the query one by one. I am doing too many Access
connections.

But with SQL Server is different I can send and entire script with out
problem.

Thanks for answering my question.

Bye

MGFoster said:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You can't put multiple statements in a QueryDef. In ADO and ODBCDirect
you can put multiple SELECT statements in a command, but I'm not sure
about multiple action (DELETE, UPDATE, INSERT) statements.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQkMZhIechKqOuFEgEQI7ewCffLJ0Hh2SkgnY5+Tup6LWn8E9kVQAnj97
qqQjXCDpDZvWBbA0wwJWFc/+
=JW/e
-----END PGP SIGNATURE-----
 
hi,
you could write and save your sql as access queries then
use a macro to run them back to back.
use the openquery action in the macro.
 

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

Back
Top