MS Access database size growing - excel

We use a MS Access database which has a linked Excel table. This Excel linked to a SQL database report. From this Excel file we load the data to an internal table of the Access database. The loading process is the following:
run a delete query (this delete all data from internal table)
run an append query which loads the data from excel to the emptied internal table
These two steps cause the file size to grow (~1150 kb/running) even though the amount of data does not change after loading!
Because of this, we need to compact and repair the database frequently.
How can I stop this growth?

Don't import the file.
You have it already linked, so create a simple select query with the linked file as the only source source, and use this to filter and convert (for example text dates to true Date values) the data and create the expressions you may need to proceed.
Then use this query as source for your further processing.
If this is not possible, (re)create a temporary database from scratch, fill a table in this, and link this to your main database.
That said, any Access database will grow when used if it is not write protected. This normally causes no harm.

Related

Load Data from Excel Power Query to Access table

I have an excel file that collects data from multiple txt files into connected individual tables (1 table per each file) as connection only tables. I have done this because some of them contain >1m tables. In excel, I have appended those tables using Power Query/Apend function. I need to create a new table that contains all the data, however the resulting data is >1m rows, and I can't load it back to excel.
Is there a way to load my connection (summary of all tables) to access?
When I try to do that using import function in access, it does not recognise the connection as a table so I am not sure how to do this.
Thank you,
Load it to the Excel data model which doesn't have a 1m row limit.
You cannot load from PQ to Access (nor would you want to).

Delete Power Query steps after loading to Power Pivot data model

I need to delete query steps after loading the data into model. The reason is to hide the sources, protect our know-how, or maybe I'm just not very proud of what I've done ;).
But when I delete PQ connections or change "Load To" option, also the tables disappear from data model and pivot table becomes unresponsive. It's also not possible to modify or delete the connection created in Power Query from Power Pivot window, or even view table properties.
I could use Review > Protect Workbook > Protect Structure to disable viewing and editing queries / connections, but the steps are still visible, and the user cannot modify the workbook; even pivot table drill-through function doesn't work as it needs to create a new sheet to show data rows.
If you need to remove the query steps, then you have to store the data within the Excel file (since a query is just a set of instructions for how to connect to the data and transform it).
What you can do is create a query, load it to a table in an Excel sheet and then delete the query, leaving a static table. You can then create a pivot table using this static table as the source and it should function normally (though you obviously won't be able to refresh the data). I.e. don't create a data model until you've loaded your data and removed the query.

How to Access a Global Temporary Tables from Excel and Other Applications

We are trying to access a temporary table that is generated by SQL Anywhere in excel and some other applications. When the database information populates in Microsoft Query and Database Tools none of the temporary tables are visible.
I've tried running a query on the table itself and it returns no data, however when one of our software packages with an inbuilt connection connects to the same temporary table it populates the last two rows in the queue. I've tried to create a view of the table and it returns no data as well. This is my first time working with global temporary tables and I'm wondering how external applications are able to connect and pull the data.
SELECT * FROM tmp_table;
This returns no results but the table structure. Though at some point this table is generated and either maintains the data in memory or in some other way as one of our applications has an inbuilt connection that is reading that data.
How does one connect to and draw data from a global temporary table in SQLAnywhere/MSSQL?

Excel internal database connection

I built a data entry UserForm to populate a worksheet that will serve as the raw database. The raw data requires further manipulation and analysis in order to be reported, so I set up a database connection using Get External Data>From Microsoft Query>Excel Files, pointed it to the file I was already working in, selected the fields I wanted and performed basic functions on those I wanted aggregated. This creates an Excel table where I then use formulas that to complete the analysis. It works great for me; I can add entries to the database, Refresh the summary table, the new entries are added and the formulas populate automatically.
The problem is that no one else can refresh the table because it's looking locally for the file. The connection string is:
DSN=Excel Files;DBQ=C:\Users\MyName\Desktop\Folder 1\Results.xlsm;DefaultDir=C:\Users\MyName\Desktop\Folder 1;DriverId=1046;MaxBufferSize=2048;PageTimeout=5;
I have a very basic understanding of the database connections, but I need this file to be as automated as possible by request of my colleague. Can I fix the connection string so that the file is "flexible" and can be refreshed on any computer? Is this the best solution? If not, what else can I do that does not involve downloading additional plugins or 3rd party add-ins?
If what you need is a file containing the raw data (a Database) AND one or more excel files connected to it that pick up the data from the database and work with this data, you need to split the two things. You can do the database with an access file located on a shared directory with an appropriate table and you can reproduce the user form in this file so the insertion of the data will be made in this file. Then you connect one or more excel files (using connection Mode = Share Deny None, so you can update the data and at the same time work with them from the excel files), the data will be imported in the files in tables and here you do all the proessing you need.
If one file is enough for you (you don't need to have a database with the row data separated and you don't need to use the file from different location simultaneously) and all the problem is that if the file is opened from a different location from the one specifyed in the connection string it does not work...well in this case (that seems the case) i don't know why to use a connection to the same file.
If what you need is a table for work with, just create it selecting the range with the data you already have inserted (Create a table - quick start guide) and then when you add data through the form instead of adding them in a "normal" row, add them to a new row of the table with something like WorkSheets("name").ListObjects("table_name").ListRows.Add and add the data in the new table row.

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.

Resources