473,498 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I have 50 make table queries that write tables to a back end databsae. The path chang

4 New Member
I have an access database that is split into a front end and a back end database. I have around 50 make table queries that make a table in the back end database.

Currently I have the Another Database radio button checked
Under filename I have referenced a Path and the back end database name.

A user may request the back end database to be placed on a shared server so multiple people can access it. So I have to go into each make table query and manually change the path. This can be cumbersome as I have multiple locations using this.

Looking for a way to change the path once and it changes all the path references in the 50 make table queries. I tried creating a table with the path and then I used a dlookup function in the field. The front end database closed when I did that.
Jun 18 '19 #1
8 1390
zmbd
5,501 Recognized Expert Moderator Expert
... I have around 50 make table queries that make a table in the back end database...
OH MY
WHY?!?!
This will lead to bloat like few other things do and suggests that you may need to really look at the table structure for normalization
Bytes > Sitemap > Microsoft Access / VBA Insights>Database Normalization and Table Structures



As for you database closing:
Did you have open, linked tables, or any object bound to them open, to the backend at the time? Changing the path to the link while they are open will usually toss an error; however, there can be strange effects and a frontend crashing is one of the possibilities. Before you can make the change all tables, queries, and forms bound to the linked tables must be closed.

Normally I would suggest using VBA to create a dynamic set of SQL that pulls the path from your backend and then uses the db.execute method. This is what I use when I archive data out of a production database into a subset backend.

Would you mind posting a copy if the SQL you are using?
Of course, you'll want to use generic paths and please make sure that you used the [CODE/] formatting tool
Jun 18 '19 #2
GTC07300710
4 New Member
One point of clarification. Each make table queries make a different table in the back end database. 50 make table queries /50 different tables.

Expand|Select|Wrap|Line Numbers
  1. SELECT
  2.    SAPMaterialDL1.Plant,
  3.    Replace(LTrim(Replace([SAPMaterialDL1].[Material Number], "0", " ")), " ", "0") AS [Material Number],
  4.    SAPMaterialDL1.[Material Description],
  5.    SAPMaterialDL1.[Material Type],
  6.    SAPMaterialDL1.[Base Unit of Measure],
  7.    SAPMaterialDL1.[MRP Group],
  8.    SAPMaterialDL1.[Plant Status],
  9.    SAPMaterialDL1.[MRP Type],
  10.    SAPMaterialDL1.[Planning Time Fence],
  11.    SAPMaterialDL1.[MRP Controller],
  12.    SAPMaterialDL1.[Lot Size Key],
  13.    SAPMaterialDL1.[Min Lot Size],
  14.    SAPMaterialDL1.[Max Lot Size],
  15.    SAPMaterialDL1.[Assembly Scrap],
  16.    SAPMaterialDL1.[Rounding Value],
  17.    SAPMaterialDL1.[Procurement Type],
  18.    SAPMaterialDL1.[SP Key],
  19.    SAPMaterialDL1.[Planning Calendar],
  20.    SAPMaterialDL1.[SM Key],
  21.    SAPMaterialDL1.[Safety Stock],
  22.    SAPMaterialDL1.[Min Safety Stock],
  23.    SAPMaterialDL1.[Safety Time],
  24.    SAPMaterialDL1.[Safety Time / Coverage],
  25.    SAPMaterialDL1.[Profile for Safety Time],
  26.    SAPMaterialDL1.[REM Allowed],
  27.    SAPMaterialDL1.[REM Profile],
  28.    SAPMaterialDL1.[Plant Deletion Indicator],
  29.    SAPMaterialDL1.[Quality Inspect],
  30.    SAPMaterialDL1.[Storage Bin],
  31.    SAPMaterialDL1.[Old Material Number],
  32.    SAPMaterialDL1.Field31 INTO SAPMaterialDL IN 'C:\Folder\CSSTRbe.accdb' 
  33. FROM
  34.    SAPMaterialDL1;
Jun 18 '19 #3
zmbd
5,501 Recognized Expert Moderator Expert
Yes, we're aware of what the maketable action query does...

You have 50 of these - so 50 tables once ran.

How are you running the queries?
Jun 19 '19 #4
twinnyfo
3,653 Recognized Expert Moderator Specialist
Why not keep the DB BE on the Server, using the unchanging Network address (e.g., \\ServerName\Directory\Folder\Database\). Thus, the path would never change. This is a principle used in this Article which describes User Permissions in MS Access. Although that DB may be much to chew on, the principle is the same.
Jun 19 '19 #5
GTC07300710
4 New Member
I am running the queries through a macro.
Jun 20 '19 #6
GTC07300710
4 New Member
Hi twinnyfo,

Each site has their own server so the network address changes.
Jun 20 '19 #7
Rabbit
12,516 Recognized Expert Moderator MVP
What is the purpose of all this? I suspect you don't actually have to do all of this and there's a much simpler solution in which you just copy and paste a file.

But we can't guide you to a more efficient solution until we know why you need to "make 50 tables" for each site and why each site is constantly changing the location of their back end.
Jun 20 '19 #8
zmbd
5,501 Recognized Expert Moderator Expert
2nd Rabbit - exactly what I was saying in Post-#2

> You're going to have to look at moving to VBA from the Macro language. Macros are not going to be able to handle building the strings very well and are very difficult to trouble shoot.
I'll have to see if the [Tempvars] collection could be used for the pathname in the action query. Most likely you'll have to directly place it within the SQL view if it's possible.

> Looking at SAPMaterialDL1.[Safety Time / Coverage]
Reccomend removing that slash - it will cause you issues at some point in time - especially with macros!!!!
IMHO, one should only use alphanumerics and the underscore for field names, table names, file names, and other items along these same lines.
Error message when you use special characters in Access databases Applies to: Microsoft Office Access 2007Microsoft Office Access 2003

I highly advise replacing the spaces with the underscore in all of your table designs.
SAPMaterialDL1.[Safety_Time_Coverage],
or
SAPMaterialDL1.[SafetyTimeCoverage],
this will make writing your SQL much simpler.
Jun 20 '19 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1967
by: valexena | last post by:
How can I improve performance of queries on tables containing all words in the dictionary starting with the letter ‘S’? -- Posted via http://dbforums.com
2
2910
by: Daniel | last post by:
if System.IO.StreamWriter write throws an exception, is there anyway to close the System.IO.StreamWriter object? it seems to stay open when this happens then future attempts to write to that same...
3
1764
by: Stephen | last post by:
It is possible to relate queries to tables, right? It seems logical but when I try to match my queries to any of the tables or even to each other it gives me a blank relationship. What could I...
0
1280
by: Nolan | last post by:
I have an XML document from another database that I can successfully import into Access. There are multiple tables and they all parse correctly into those tables in Access. I can manipulate the...
1
1345
by: Jason Shohet | last post by:
We have an app that queries 5 tables into a dataset. Now, lets say 1 of those tables is about to change due to user input on a webpage. Right now, we are manually updating the db with an update...
8
2514
by: Janelle.Dunlap | last post by:
My database is linked to external data from a single Excel spreadsheet. I currently have it so that the entire spreadsheet exports into one table, but really for the purpose of my database it will...
0
1591
by: Buglish | last post by:
Hi, Task : -Capture a HTML table with use of regular expression from a text string buffer(entire document). –Pass it to another function to create a multi dimension array out of it. - Pass it...
0
2013
by: Jeff McNeil | last post by:
Your args are fine, that's just the way os.path.walk works. If you just need the absolute pathname of a directory when given a relative path, you can always use os.path.abspath, too. A couple...
0
5789
by: Stewart Ross | last post by:
The attached database zip file is an Access 2003-format exemplar which contains a custom form that provides a one-stop front-end for the creation, listing and manipulation of queries and tables. The...
5
7565
by: bush3102 | last post by:
I have a table in MS Access that has +17K of records. I am trying to break down that table into smaller tables of 500 records each. Using the following code, I am able to create the temp table, but...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7167
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.