473,388 Members | 1,499 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,388 software developers and data experts.

Disable Access query rewriting

Hello,
I would simply like to know if there's a way to disable the "feature"
of MS Access that rewrites your queries "correctly"...

This feature makes this : ...WHERE SomeBooleanField...;
Become : ...WHERE (((SomeBooleanField)<>false))...;

that's not so bad since the essential is kept in place... but here's
MY problem :

My query needs a LEFT JOIN using a Between Operator Like this :
FROM Students AS s LEFT JOIN Grades AS g ON (s.Average BETWEEN
g.LowestAverage AND g.HighestAverage)

Ms Access can handle such a join perfectly... but as long as you close
the Query or any object u wrote that in... the super Rewriting feature
comes and REVOMES THE PARENTHESIS AROUND THE BETWEEN... which makes
Access refuse to execute the query because of a missing operator....
which is really stupid!

So please if anybopdy know how to remove that rewriting feature from
my Access or how to write a LEFT JOIN using a BETWEEN operator in
another, please help me... i'm stuck!

Thank you very Much
StaZ
Nov 13 '05 #1
2 1946
Hi StaZ

I don't know if this will work, but it's worth a shot.
Try assigning the SQL property of the QueryDef directly.

Example:
Dim strSql As String
strSQL = "SELECT ...
CurrentDb().QueryDefs("Query1").SQL = strSQL

You cannot open the query in Design view anyway with this kind of query, and
I would expect Access to leave your query alone if it were forced to save
the SQL in this way, unless you did open it again form the interface.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"StaZ" <St*****@gmail.com> wrote in message
news:99**************************@posting.google.c om...
Hello,
I would simply like to know if there's a way to disable the "feature"
of MS Access that rewrites your queries "correctly"...

This feature makes this : ...WHERE SomeBooleanField...;
Become : ...WHERE (((SomeBooleanField)<>false))...;

that's not so bad since the essential is kept in place... but here's
MY problem :

My query needs a LEFT JOIN using a Between Operator Like this :
FROM Students AS s LEFT JOIN Grades AS g ON (s.Average BETWEEN
g.LowestAverage AND g.HighestAverage)

Ms Access can handle such a join perfectly... but as long as you close
the Query or any object u wrote that in... the super Rewriting feature
comes and REVOMES THE PARENTHESIS AROUND THE BETWEEN... which makes
Access refuse to execute the query because of a missing operator....
which is really stupid!

So please if anybopdy know how to remove that rewriting feature from
my Access or how to write a LEFT JOIN using a BETWEEN operator in
another, please help me... i'm stuck!

Thank you very Much
StaZ

Nov 13 '05 #2
Hi Mr. Browne

Thank you very much for your answer, it's a wonderful way to override
the "power" of access... i inserted this code u posted me in the
Report_Open event of my reports and it works wonderfully :)

thank you very much!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

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

Similar topics

5
by: Jahmil Richardson | last post by:
Attempting to query MS Access database with the ODBC drivers for PHP. When using the LIKE statement no records are returned. Example: $query = " Select * From Dispatch Where Customer Like...
13
by: Peter James | last post by:
Access 97 If I select New on the Query tab of the db window, and go staight to sql view and type in the following for example: INSERT INTO tblMyTable ( dtDate, txtAny) VALUES (#2003-09-03#,...
29
by: Mark B | last post by:
We have an Access app (quite big) at www.orbisoft.com/download. We have had requests by potential users to have it converted to an SQL version for them since there corporate policy excludes them...
3
by: Eric Ellsworth | last post by:
Hi all, Does anyone have any bright ideas for Access' tendency to add square brackets when it parses queries, then tell you that the query syntax is invalid. In my case, I'm trying to do a LEFT...
7
by: Rob Richardson | last post by:
Greetings! I am rewriting a VB6 application in VB .Net. The database (which was converted from Access 97 into Access 2000) has two nearly identical queries. One, called GetNewOrderNumber, is: ...
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...
16
by: JoeW | last post by:
I'm utilizing a database that I created within MS Access within a program I've created in VB.NET. I am using the VB front end to navigate the information, but want to be able to print a report,...
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
5
by: teddysnips | last post by:
Having upsized my client's back-end DB to SQL Server, the following query does not work ("Operation must use an updateable query"). UPDATE tblbookings INNER JOIN tblREFUNDS ON...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.