473,471 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Stop Access saving 'broken' queries

Anyone know how to prevent Access 2002 from automatically breaking all
the incorrect joins in a query and then automatically saving the broken
query?

This is what I would call stupid design behaviour...Access takes your
'broken' query and auto saves it as what I call a 'corrupt' query...

1. Rename some BE tables and attributes
2. Open your FE
3. Open a query in design view that you know to now have broken names
and joins
4. Access intercedes and to inform you "can't represent joins etc..."
5. Close the query design without saving it
5. Note the 'modified' date of the query is now today.

Access has now overwritten a broken query with a totally f&*ked,
'corrupted' query and killed all the joins - the SQL joins have now
been expunged - ie. corrupted - automatically by simply opening the
qeury in design view.

And you can't read the query definition using VBA to find out what the
original SQL looked like so you can restore the joins because it's been
'fixed' by Access automatically.

Anyone have a configurable solutuion to this?

(My coded solution is to run a For Each QDF procedure to populate a
table with all the QDFs so I can edit them and test/rerun them in a
sandpit query form without having Access intervene to futher corrupt my
borken query)

Cheers
Greg

Jul 26 '06 #1
4 3077
(My coded solution is to run a For Each QDF procedure to populate a
table with all the QDFs so I can edit them and test/rerun them in a
sandpit query form without having Access intervene to futher corrupt my
borken query)
Have you thought about extending your current solution to ask code to
do the edit as in:

Dim q As DAO.QueryDef
For Each q In CurrentDb.QueryDefs
q.SQL = Replace(q.SQL, "TestDate", "TrialDate")
q.SQL = Replace(q.SQL, "OldTableName", "NewTableName")
' etc
Next q
?

Now, you might have some difficulty with "TestDate" or "TrialDate"
being part of another word; in that case you may know how, or could ask
for a RegExp function/solution that would replace whole words only.

Jul 26 '06 #2
Indeed Lyle - that's a useful enhancement.

To date, I've done find/replace in the 'memo' field holding the QDFs
SQL string - but coding many of those replacements with the QDF object
is clever - and programmable.

(My QDFs form displays options to edit the saved SQL string - not the
original query 'cause Access would intercede - to create a temp copy of
the SQL, to test the copy as a QDF (docmd.openquery... etc.) and then
overwrite saved version if all okay.

This is all required because of a physical rebuild and BE merge - so
lots of chained queries (~100) to fix.

I guess what I'd really like is for Access to not think for me and
allow me to hold dead queries until I decide to fix them, and not
assume to proceed to clean up the broken links...by removing them.

Greg

Lyle Fairfield wrote:
(My coded solution is to run a For Each QDF procedure to populate a
table with all the QDFs so I can edit them and test/rerun them in a
sandpit query form without having Access intervene to futher corrupt my
borken query)

Have you thought about extending your current solution to ask code to
do the edit as in:
Jul 26 '06 #3
Sky
In my experience with Access 2000 and 2003, you can cancel the save, and the
query remains unchanged.

Perhaps you have "Name AutoCorrect" turned on, under Tools, Options,
General? That should be disabled.

- Steve

<tt**@ozemail.com.auwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
Anyone know how to prevent Access 2002 from automatically breaking all
the incorrect joins in a query and then automatically saving the broken
query?

This is what I would call stupid design behaviour...Access takes your
'broken' query and auto saves it as what I call a 'corrupt' query...

1. Rename some BE tables and attributes
2. Open your FE
3. Open a query in design view that you know to now have broken names
and joins
4. Access intercedes and to inform you "can't represent joins etc..."
5. Close the query design without saving it
5. Note the 'modified' date of the query is now today.

Access has now overwritten a broken query with a totally f&*ked,
'corrupted' query and killed all the joins - the SQL joins have now
been expunged - ie. corrupted - automatically by simply opening the
qeury in design view.

And you can't read the query definition using VBA to find out what the
original SQL looked like so you can restore the joins because it's been
'fixed' by Access automatically.

Anyone have a configurable solutuion to this?

(My coded solution is to run a For Each QDF procedure to populate a
table with all the QDFs so I can edit them and test/rerun them in a
sandpit query form without having Access intervene to futher corrupt my
borken query)

Cheers
Greg

Jul 26 '06 #4
Oh - that sounds entirely feasible Sky, gonna give it a go.

(Sorry for delaying in responding)
Thanks
Greg
Sky wrote:
Perhaps you have "Name AutoCorrect" turned on, under Tools, Options,
General? That should be disabled.
Aug 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Frnak McKenney | last post by:
Back when computer dinosaurs roamed the earth and the precursors to today's Internet were tiny flocks of TDMs living symbiotically with the silicon giants, tracking access to data processing...
2
by: Atreju | last post by:
I apologize in advance for the x-post, but I am really not sure where this would best be addressed. I am designing a database in MSAccess for which I want to make the front-end in VB. I have...
1
by: J. Koskey | last post by:
Background: We have hundreds of codes = specific departments, but there are frequent changes/additions to the info. For users to look up definitions, we had set up a way in Access to create a...
1
by: ANSWER | last post by:
Hi, I want to Stop users to import my tables and queries into their database. Is there some VB code or is only solution to make security workgroup permission. If this is the only solution...
18
by: Andre Laplume via AccessMonster.com | last post by:
I have inherited a bunch of dbs which are are shared among a small group in my dept. We typically use the dbs to write queries to extract data, usually dumping it into Excel. Most dbs originated...
14
by: Amitabh Deepak | last post by:
Is there any way to check whether daylight saving is enabled on a linux machine?
10
by: Hank | last post by:
We have just recently migrated the data from our Access 2000 backend to Postgres. All forms and reports seem to run correctly but, in many cases, very slowly. We do not want to switch over until...
0
MMcCarthy
by: MMcCarthy | last post by:
Rather than using the Access design view change the view to SQL. I am going to attempt to outline the general syntax used for SQL queries in Access. Angle brackets <> are used in place of some...
3
by: Shiny Star | last post by:
I have 4tables & I write class for all those table to hold a tables information as one whole unit. I am using MS Access queries, just like stored procedures so the queries (select, update, delete,...
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,...
0
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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
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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.