Split database: where are queries located and how to view SQL? - ms-access

I'm redeveloping an Access + VB based application to C# and SQL server. I am working with the split versions of the Access database. In the front-end file when in design view I see code like this for some event routines to lookup a value from a query:
DLookup("someField", "someQuery")
This is probably simple but I cannot find where "someQuery" and queries in general are located and how to view them. They don't appear in the backend file and I can't see how to list them in the front end file. I haven't had any luck searching the net only that this suggests they are located in the front end file. How can I view the SQL for these queries?

Since you are unable to open the Navigation Pane, you could create a new db file and import queries from the front end into the new db (see the Import section of the External Data ribbon). Without the linked tables, those queries will be non-functional, but that effort will allow you to identify which queries exist and you may examine their SQL if that is helpful.
You could even create links to the back end tables and import anything else you may need from the front end db.

Related

Splitting Access Databases

I have an access database that I have been using for a while. I have been meaning to split the database for a while but hesitant to. I have many forms that link to tables. VBA code that aid in the forms and creating reports from this access database. Sometimes the VBA code will have a dynamic query that changes on certain conditions and runs a DoCmd.RunSQL.
If I split the database will all my VBA code break down as it points to the tables within my database. Do they need to be pointed to the backend or pointing towards the linked table is enough. Will the split handle this by itself?
Let me know If I was clear enough. My main concern is my forms/VBA code will stop working.
Make a backup, go to meny Database Tools, locate the Split database wizard.
Run this, and you are done.

Macros / Functions available for all the databases

I wrote a function in visual basic which I can use in any query or form of given access database by adding the module. What I want is to able to use the function in all the databases in my machine.
A simple solution is to copy the module everytime to the database, but is there any simple solution?
In excel you can do this by adding the function to a .xla file and then copying the file to XLSTART folder. But MSACCESS doesn't have any such equivalent folder.
Can someone suggest something?
Here is a complete tutorial: Using a centralized VBA module in multiple Access databases
Make your "helper" database. Put a few procedures in there.
In your 'client' databases, open the VBA Editor
Go to Tools->References. Browse and select your helper database.
Done! You can now use all the functions in your helper database
throughout your client databases.
[EDIT]
There's no way (and it's really unnecessary) to create database which automatically starts with MS Access application.
I think that you're looking for a way to create template database which contains the set of custom objects, such as tables, vba module(s), forms, queries, etc.
See:
Save and reuse database design elements
Easy Access with templates I: Create a database

Access 2010: Can't access query after splitting DB

I split my DB and now when I try to change some information on a few queries, I can't access them. I have a front end and a back end and understand that I should make changes to queries/forms via the front end, but they are grayed out and inaccessible.
At this point, I tried unsplitting the DB (which I believe I did), but I still can't edit those queries or forms.
I can click on the query/form and see the result of it, but I can't get to design view to edit it.
I'm taking a shot in the dark and saying that in the process of splitting your database, you either created your front-end in an accdr or accde format (a runtime application). The purpose of this is that you shouldn't be able to open queries or forms or tables in design view on the front end. You can just open your database and save it again as an accdb file and continue as normal.
If you're having other problems with the linked tables, I suggest you open the Linked Table Manager and refresh the links (if you moved the backend file, this is necessary).
I would recommend trying to proceed as normal by using Shift Bypass just to be sure. ( Hold the shift key when you start the database. Then attempt to modify in design view).
If these fail, I would attempt to copy the queries and /or forms if possible and create new ones.

Query Performance: Using saved queries vs adding constraints during runtime to a query

I have multiple forms with specific buttons to show/hide data (f.e. data from last year/all data). I've been thinking a while about query performances and I can't really find a good source which explains how access handles those.
In particular I was wondering, if there is a performance difference between using a saved query (for a specific case, like 'data from last year') and appending parameters to a query during runtime (say add 'where xy = -1' to a query with no constraints). Will both querys be executed in the backend, or will any constraints I add to an existing query via VBA be executed in the frontend?
Should I create a query for every possible scenario or use only one query where I add parameters during runtime?
Fyi I'm using jet and my database is split to frontend and backend (Access 2007). The backend will be located on a network folder.
Check the answers to this question: does stored procedure enhance the performance in an acess databank,why?
Mostly covers what you are asking for.
As Access is a file based system rather than a dedicated server, absolutely nothing is run in the back-end, even if it is stored there, everything is executed locally in whichever copy you have open, namely the front-end or the back-end.

Only have forms on the front end split

In Access 2007, I split my database (which only contains tables and forms) into front end and back end. I want my front end to only have forms, while my back end only have tables.
When I split the database, the front end has tables and forms while my back end only has tables. When I try to remove the front end tables, the front end forms don't work.
I am completely new to Access and cannot find the answer.
In the end I want to give the forms out to multiple people and not have them see what other people input into the forms and to have the information on the table in the backend.
Thanks in advance!
You should probably have a look at using linked tables in the front end
About importing and linking data and database objects
MS Access: Link to a table in another database in Access 2007
A linked table in Microsoft Access is not actually a table that contains any data. It is just a shortcut to a table that resides in a different database, usually called the backend.
When you split your database the front-end should contain forms, queries, macros and code modules. And also linked tables that point to the backend database.
The backend database therefore would just contain the base tables.
Note if the backend database is moved then the linked tables will no longer work as the link would be broken.
You can either manually split your database or use the menu option built into the user interface, In Access 2007 click on database tools, then in the move data group click on access database.
To manually link tables, open your front end database and select External Data on the ribbon then click Access then after you've selected the file name make sure you select the 2nd option to link the table in the dialog box that opens.
It's a good idea to put the backend database on a server that does not get turned off and when linking avoid using mapped drives in case all users have not got the same letter mapped to the same folder share.