Can vba run a access query from excel?

pedie

Well-known Member
Joined
Apr 28, 2010
Messages
3,875
Hi, can vba run a access query from excel? if yes, please show me an example code...
Thanks in advance!:)
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
pedie

What type of query is it you want to run?
 
Upvote 0
Norie, the query name is "Query1"
This query delete records in database when certain conditions are met.:)
Any advice from your side too?
 
Upvote 0
pedie

That's what I wanted to know - it's an action query.

ie it does something, not just returns records

So it is a quey that's 'executed'.

One thing I don't quite get though is why create an instance of Access just to run a query/macro.

You could get the same results using DAO or ADO.:)

Just kind of a personal opinion though.
 
Upvote 0
Norie, i always try to know different ways so that when things come my ways...then i still dont get caught up...:biggrin:
'm not doing anything as such as of now but when there is something i always do that is often update data to access base then sometime needs to delete some of them again so which i have to open the access file and then delete and close it back....so thats why:).

Thanks again
Pedie
 
Upvote 0
pedie

So why do you need any code?
 
Upvote 0
Can we do that without any code?:) running access query from excel? maybe 'm confused too..
 
Upvote 0
pedie

That wasn't what I was saying.

Perhaps I misunderstood but I thought you were saying you were opening Access and some point.
i have to open the access file and then delete and close it back


I was suggesting if that's what you were doing why not just run the query then.
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,790
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top