Connecting many Excel data tables to Access queries - excel

We need to update about 40 Excel data tables from queries in a single Access database, on demand. Ideally, Data > Refresh All should perform the update.
I’ll want to use VBA to set this up; a master Excel table identifies the data tables and corresponding query names.
What’s a clean way to design this? Should my VBA use ODBC, OLE DB, or ADO to create 40 database connections? (For maintainability, I'd prefer not to have a lot of VBA complexity, since our shop doesn't otherwise use these APIs -- just Excel with simple VBA.)
I’m running MS Office 2013.

Related

Excel create multiple MS Queries using one data connection between two sheets in the same workbook

In Excel 2021, what exactly is a "data connection", "query" and "domain source name"?
Let's say I have a Workbook "Manahil_Customer_Database.xlsm" in which I have a sheet "sht_Customer_Cities" that has a table "tbl_Customer_Cities". In a new sheet "sht_Report" I want to run two queries using one connection via MS Query. Now when I go through the MS Query route I get one Domain Name Source File "Manahil_Customer_Database.dsn" and one MS Query file "Customer_Countries_Cities.dqy" and one Connection file "Customer_Countries_Cities.odc".
However when I look at the "Queries & Connections" it says 0 Queries and 1 Connection named "Customer_Countries_Cities". I want to be able to establish a single Data Connection via MS Query from the "sht_Report" to the Workbook "Manahil_Customer_Database.xlsm" and than run multiple queries using the same connection.
Power Query replaced MS:Query from Excel 2016 onwards. The objects and panes you are describing relate to Power Query, not MS:Query.
Power Query is far more functional, reliable, flexible and performant than MS:Query.
For example depending on your exact requirement, you might create a base query that gathers all the required data, then refer to that base query in Reference queries that filter the output needed for each destination table.
Here's a starting point for Power Query:
https://support.microsoft.com/en-us/office/about-power-query-in-excel-7104fbee-9e62-4cb9-a02e-5bfb1a6c536a
Power Query is a MS tool that assists you on your ETL tasks.
As read in a previous answer, it is based on M language.
To be able to import / modify / connect your data, the command is:
DATA / GET DATA and select your input
Check this link for a quick introduction:
https://learn.microsoft.com/en-us/power-query/power-query-what-is-power-query
If I understand the situation correctly, you are working internally, within a single excel file. Data connections, queries, and domain sources, are all used to associate externally.
Internally I would think you could use a pivot-table and/or a slicer.
If you provide additional details on what specifically you are trying to do, a better answer could be provided.
Some additional reading below may help further:
Power Query Help
Data Connections
Queries
External Links

Importing data from excel to multiple tables in Oracle DB

I have an excel sheet with a single workbook with data in it. The data is around 1000 rows and 50 columns. I need to import these data to an Oracle DB every week. Here comes the problem, the columns in the sheet belongs to different tables with some columns go in multiple tables. I use SQL Developer V.18.1.0.095. Thanks in advance for the help.
Note: I created a temp table and copied all data to it, then wrote the query to push each column to its respective tables. But, I feel its complex and think it won't work. Is there any better way.
PL/SQL Developer has special tool for tasks like this, calls ODBC Importer (Menu 'Tools'-> ODBC Importer).
For use it you have to set Excel File in USER / System DSN field and your domain user and password, and push Connect after.
After connection developer will ask you path of excel file, and after you can create table in heiborhood tab for your dataset.
Or, you can use sql loader. Ask google how to. It's easy.

Is it possible to use MS Excel as front and back-end for MS Access?

in a few words, I would like to use MS Excel together with MS Access, such that Excel is the front and backend, but Access provides the capability for relations between data and sql queries. Is that possible?
In a few words more, I would like to use MS Excel together with MS Access such that :
the 'raw data' is visible and accessible from Excel ((write, modify, delete data entries!)
I can use SQL queries to query my data via MS Access (and hence dynamically create different views on my data as excel sheets)
I can implement relations between the data via MS Access (for consistency checks, etc)
My own research got me here:
I know how to set up access to use an excel table as its data backend (both, linked to or copied from excel)
I know how to send SQL queries from Excel to an access database and display the results in excel sheets
However, here is what's missing:
in Access if I use tables that are linked to Excel, I cannot create relations between tables (access says it's not possible)
in Access if I use tables that are imported (copied) from Excel, I can create relations between tables, but after creating relations I cannot update my import anymore (access says it's not possible, I'd have to remove the relations before)
In any case I have to trigger updates manually ...
Background:
Excel is currently used for project management. The management process often involves 'exploring the data', e.g. assigning people different projects, adding people, adding projects, ... and then seeing how that affects other things. (Hence) it is required that Excel is kept as the platform. But it would be nice to have database feature like linked tables and queries, as data is getting too complex to manage with excel only tools. Also, this is not a large project, but I'm aiming for an easy and not complex solution.
Basically I want to keep excel and everything, I'd simply like some new features (e.g. relating tables, sql-like queries).
So, does anybody have an idea how to go about this?
Thanks a lot!
I have been using a lot Excel as Front-end and Access as Back-end.
Typically, my solutions involve UserForms or ActiveX Objects in Excel Sheets that manipulate and show data that is stored in an Access database. The Excel file and Access file are completely independent, which allows you to create and alter relationships in Access without restrictions. Just make sure you update your queries in Excel. There are even some cases that I use more than one Workbook to access the same Access database.
I make Excel communicate with Access via Excel VBA, using the ADODB. A quick Google search got me to this tutorial.
Cheers,
Tiago

Creating a table in Excel

I was working on project for my company. The requirements are to create an excel report at the end.
The way I am currently coding/thinking.
Remote Server ---> Local Access table --> give user a UI to filter data however they want --> Export to excel.
However, one of my analysts asked me if we can stay away from access and use Excel only. So I was wondering, is there a way to create a "table" like access table in Excel? This way, when I import data from remote server, I can put it in a table (IN EXCEL), create a form for UI, and have everything contained in one file.
I can't paste the raw data into a sheet because of performance issues (however, I have not tried it. I just assume that it is a lot faster to query a 'real' table then to search through excel cells).
Can you think of a alternate solution?
One option is to use Microsoft Query to directly access the remote database. In this case, the users would need to use the UI of MS Query (which isn't the prettiest) for filtering, but it would get the job done without needing the intermediate database.
Here is a good reference from the Microsoft site.

How to link ms excel 2003 to ms access 2003

I have office 2003, and i have develop a database from ms access 2003.
What i want is to link ms excel and ms access so as when am updating either of them both will be updated
I know that from within Access, you can add a "linked table" with an Excel worksheet as a data source. This will cause the data in the Excel sheet to show up as a table in Access. When you make changes to the data in Access, the data in the underlying Excel sheet will change. Also, if you open up the Excel sheet and change the values in one of the rows, the change will be reflected when the link in Access is refreshed.
However, there can be issues when trying to link Access and Excel together. You may not be able to edit the same document from Access and Excel at the same time. Also, if you add additional columns or rows to your source data in Excel, you may have to completely re-link the table in Access.
If you are the only user of both the Access application and Excel sheet, you can develop a fairly robust solution using this method. However, you have to be careful with trying to deploy a solution like this with multiple users because you may start to get issues with multiple people trying to edit the same document at one time. At this point, you may need to look at more robust solutions involving a database or SharePoint backend.
As Ben said in his answer it is possible but can easily lead to problems in a multi user environment. I would suggest keeping the data in access and pulling it from excel. Or revisiting if excel is needed at all to update the date (read only reports would be ok)

Resources