473,385 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

...as expr1,

124 100+
I'm not sure why, but there is a split database which regularly has fields in the sql code of front end queries change from "FieldName1, FieldName2" to "Fieldname1 as expr1, Fieldname2 as expr2, etc, etc, etc. This happens on about half the queries in the database on a regular basis. I think it is probably corruption, but wanted to see if others here had similar issues. I compact the database regularly. I was thinking of running an autoexec procedure on the database that would go through all queries' sql and replace "FieldName as expr1" with "FieldName," etc. wherever it finds expr in the sql code. Does that seem like a viable plan? The problem is that people copy the front end down to their local hard drives and it would be nice if I could at least fix the issue in the front end that they copy.
Mar 14 '16 #1
3 2584
jforbes
1,107 Expert 1GB
You might be able to do that. It might take some time to perform that operation, so if you were to do it every time the database is opened, it may become bothersome.

What really concerns me is that I'm having trouble imagining how that could be happening unless your users are some how getting into the definition of the Query itself. You wouldn't happen to be opening the Query and showing it to your users? ...allowing them to go into design view. If you are, you might want to wrap the query in a Form in attempt to have this problem go away.
Mar 14 '16 #2
BikeToWork
124 100+
With Access (especially now without mdw workgroup files) users can do pretty much whatever they want with an Access database. I don't "think" any users are changing queries in design mode and knowing the users here it is doubtful. Could it be that the database becomes disconnected from it's back end tables momentarily and queries can't find the fields, thus replacing field names with expr1, expr2, etc.? I have been working with Access for years and in the past this only happened if a table's fields were gone from the database, but the queries remained. Thanks for the reply.
Mar 14 '16 #3
jforbes
1,107 Expert 1GB
With your experience, your familiar with the way Access will attempt to update any expressions a Query when it's opened in the Query By Example editor. Which can be trying at times.

But, in my experience, it will only update the Query when the QueryDef is saved by the user (or through VBA). So, someone, either the application itself or a user, has to open the QueryDef and then Save it for the QueryDef to change. I would look for what is causing your changes to happen and attempt to control it.

If you determine that you can't control it, I would go the route of creating a backup copy of the unruly Queries as templates. And then on startup of the database, copy the template queries over the working queries (the ones you intend to use). I think this would be simpler and quicker than walking the QueryDefs and performing replacements on the SQL.
Mar 15 '16 #4

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

Similar topics

2
by: Martin MacRobert | last post by:
Hi, I'm trying to make a specialisation of a template function, so that the second parameter accepts scalar types only (int,double,float etc.). How can I do this without writing an explicit...
9
by: Paul Rubin | last post by:
Is there a good reason to not define iter1+iter2 to be the same as itertools.chain(iter1, iter2)? Examples: # all lines in a collection of files, like perl <> all_lines = file1 + file2 +...
3
by: Ker | last post by:
I have a query that works great. It gives me the min for multiple fields. Within this query, I also need to get the max of some fields too. I currently have output of Date Name ...
15
by: Jens.Toerring | last post by:
Hi, I have a possibly rather stupid question about the order of evaluation in a statement like this: result = foo( x ) - bar( y ); How can I make 100% sure that foo(x) is evaluated before...
9
by: AimeeRae | last post by:
Ok. Another tricky Access question. Same database, different querry. I have a table called tbl_Responses and my tbl_Airing…similar to my question about linking Airings to Rates, I now need to...
1
by: SHAWT721 | last post by:
I am receving an "#Error" when I run the Switch function that I created. Switch(='45H4',"4502",='79H1',"7922",='79H2',"7982",='79H3',"7983",...
1
by: gtslabs | last post by:
I have a report with 2 subreports The first subreport has 3 fields (Expr1, Field1, Field2) Where Expr1 is a Date I want to highlight the 3 fields if a date is within a range of 2 dates. I was...
2
by: abdiphp | last post by:
Hi every one, I need help to get the this going, Itried whatever I can but could not get the right xpath to this xml I need to get the value of this node (IMAGE_FILE) and this is not...
8
by: Amy Badgett | last post by:
The purpose of this query is to return seven different Counts for these 14 different EIDs (employee IDs). The problem is that only 8 of the EIDs are returned: 123, 122, 108, 164, 131, 136, 138, 150....
1
by: happyelf | last post by:
I have a query that concatenates two text fields. I want the result to reside in a column on the query result. When I insert the expression (use field1 & field2) the column is labelled Expr1. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...

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.