What is quicker Access connection or VBA

mahmed1

Well-known Member
Joined
Mar 28, 2009
Messages
2,302
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi All,

I have created a connection to an Access database using the query wizard

I have 6 tables that are connected to this same database but the parameters are different on each 1

now when I refresh the Connection for each 1 it takes all in all around 1 min to refresh all..

If I was to right some VBA code to retrieve data from access and paste into the relevant tables, which 1 is quicker as with VBA I am opening the connection just the once...where as refreshing all the connections I’m assuming connects several of times...

I know there is so much more flexibility with VBa but wanted to know if it is as quicker

hopefully someone can explain

thank you
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Really depends on how/what data is being accessed.

For example a query using VBA with a select statement to the database should be quicker than say a filter applied to ALL records retrieved.
 
Upvote 0
I'd say it might depend on what you mean by "connection" - an ADODB connection? Your post reads like this is about linked tables, not a connection:
I have 6 tables that are connected to this same database
Once linked, there is no refresh needed as that happens when you open the db containing the linked tables.
If I was to right some VBA code to retrieve data from access
Why, when you can just link to Access data from Access? VBA should not be your 'go to' approach when simple queries will do the job much easier and more efficiently.
 
Upvote 0
Reads like Access to Excel connection...
 
Upvote 0
I'd say it might depend on what you mean by "connection" - an ADODB connection? Your post reads like this is about linked tables, not a connection:

Once linked, there is no refresh needed as that happens when you open the db containing the linked tables.

Why, when you can just link to Access data from Access? VBA should not be your 'go to' approach when simple queries will do the job much easier and more efficiently.

Thank you for your feedback..i didnt know which was quicker hence why i asked.

other issue i am having tho is when i tried to set up a connection at work to accessand navigate to the folder, it threw up an error saying i cant get to that folder (Maybe ITdept blocked it) but i do have access to that folder so not sure why i wont be able to connect)

i had to map a new drive to allow me to connect which is not ideal..anyone know a better way to get around it?
 
Upvote 0
Mapped drive will be fine. Probably you cannot connect using a UNC path ( such as \\server\directory\file.accdb )
 
Upvote 0
Hi Xenou - how do i get around the UNC thing
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

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