472,353 Members | 1,207 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Access SQL query incompatability (nolock)

Greetings

I am assisting a developer with an Access application performance problem and an ODBC timeout. In a nutshell they have a combo box with a drop down that queries a lookup table on a SQL Server database over ODBC and returns 30,000+ records each time it is accessed. By using a stored procedure to view the locks on the tables in the DB we suspect that a locking issue or a dead lock occurs which is causing the timeout. Once the user receives an ODBC time out they have to exit the app to free up the locks. We are trying to develop a method where a limited result set is returned there by reducing the amount locking that takes place. For the time being we are trying to modify the query to add in the 'with (nolock)':

SELECT SSN ,Name ,BEMS FROM tblClients with (nolock) ORDER BY Name

However, Access does not support 'with (nolock)' in the SQL statement. Is there a way to get around this?

Nov 12 '05 #1
4 18390
Robert wrote:
Greetings

I am assisting a developer with an Access application performance
problem and an ODBC timeout. In a nutshell they have a combo box with a
drop down that queries a lookup table on a SQL Server database over ODBC
and returns 30,000+ records each time it is accessed. By using a stored
procedure to view the locks on the tables in the DB we suspect that a
locking issue or a dead lock occurs which is causing the timeout. Once
the user receives an ODBC time out they have to exit the app to free up
the locks. We are trying to develop a method where a limited result set
is returned there by reducing the amount locking that takes place. For
the time being we are trying to modify the query to add in the 'with
(nolock)':
SELECT SSN ,Name ,BEMS FROM tblClients with (nolock) ORDER BY Name

However, Access does not support 'with (nolock)' in the SQL statement.
Is there a way to get around this?

Don't know. I'd increase the timeout value.

At the same time....30K records for a combo? The word "Ridiculous"
comes to mind.

Can you run the query from the database window? If so, I'd use a form
to search for the records. I created a generic form for my app where I
can search on any column on any table and filter based on the open
arguments the way I want.

I suppose you can use a 30K row combo (it will grow most likely), but if
I were a user I wouldn't want to.

My $.02

Nov 12 '05 #2

"Salad" <oi*@vinegar.com> wrote in message
news:F0******************@newsread1.news.pas.earth link.net...
Robert wrote:
Greetings

I am assisting a developer with an Access application performance
problem and an ODBC timeout. In a nutshell they have a combo box with a
drop down that queries a lookup table on a SQL Server database over ODBC
and returns 30,000+ records each time it is accessed. By using a stored
procedure to view the locks on the tables in the DB we suspect that a
locking issue or a dead lock occurs which is causing the timeout. Once
the user receives an ODBC time out they have to exit the app to free up
the locks. We are trying to develop a method where a limited result set
is returned there by reducing the amount locking that takes place. For
the time being we are trying to modify the query to add in the 'with
(nolock)':
SELECT SSN ,Name ,BEMS FROM tblClients with (nolock) ORDER BY Name

However, Access does not support 'with (nolock)' in the SQL statement.
Is there a way to get around this?

Don't know. I'd increase the timeout value.

At the same time....30K records for a combo? The word "Ridiculous"
comes to mind.

Can you run the query from the database window? If so, I'd use a form
to search for the records. I created a generic form for my app where I
can search on any column on any table and filter based on the open
arguments the way I want.

I suppose you can use a 30K row combo (it will grow most likely), but if
I were a user I wouldn't want to.

My $.02


We don't want to increase the time out. We want to reduce the result set
with filters as we are running into dead lock issues. However, until we can
rewrite the query associated with the combo box and test it we would like to
prevent locking while the pull down is bringing data over the wire. I think
we will have to use a pass through query to resolve the SQL compatability
problem as Access doesn't support 'with (nolock)'. Thanx for your
suggestions just the same.
Nov 12 '05 #3
You have a couple choices, but the quickest is to make sure that the query is
using the DISTINCT keyword in its SELECT statment:

SELECT DISTINCT blah...

Access insists on getting locks on tables that it requests w/o DISTINCT.

The other option is to bind the combo box to a pass-through query that calls a
stored procedure. This is the best-performing alternative.

Then again, it's a REALLY BAD programming practice to bind a 30,000 record set
to a combon box...you're much better off with some othere search mechansim
instead, using a 2-step process.
Nov 12 '05 #4

"Robert" <st*******@boeing.com> wrote in message
news:Hw*******@news.boeing.com...
Greetings

I am assisting a developer with an Access application performance
problem and an ODBC timeout. In a nutshell they have a combo box with a
drop down that queries a lookup table on a SQL Server database over ODBC
and returns 30,000+ records each time it is accessed. By using a stored
procedure to view the locks on the tables in the DB we suspect that a
locking issue or a dead lock occurs which is causing the timeout. Once
the user receives an ODBC time out they have to exit the app to free up
the locks. We are trying to develop a method where a limited result set
is returned there by reducing the amount locking that takes place. For
the time being we are trying to modify the query to add in the 'with
(nolock)':
SELECT SSN ,Name ,BEMS FROM tblClients with (nolock) ORDER BY Name

However, Access does not support 'with (nolock)' in the SQL statement.
Is there a way to get around this?


You could create a stored procedure on the server that uses the no lock
hint, (alternatively use SET TRANSACION ISOLATION LEVEL READ UNCOMMITTED.
Then call this procedure using a passthrough query, or else fill the combo
by hand with a callback function.

Tere's another method that is quite a bit of work, but may be worth it.
Create a temporary, local jet database, open a forward-only, read-only
recordset and dump the data into the local database. Then you can use this
for doing all your filtering, sorting etc. This works very well for
read-only data that you need to access frequently, such as are found in
combo and list boxes.
Nov 12 '05 #5

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

Similar topics

10
by: Thomas R. Hummel | last post by:
I have a stored procedure that suddenly started performing horribly. The query plan didn't look right to me, so I copy/pasted the code and ran it...
4
by: Robert | last post by:
Greetings I am assisting a developer with an Access application performance problem and an ODBC timeout. In a nutshell they have a combo box with...
8
by: Roy Padgett | last post by:
I have a combo box where users select the customer name and can either go to the customer's info or open a list of the customer's orders. The...
0
by: Jeff Martin | last post by:
Hello, I haven't posted here in a long time, but the last time I got excellent advice. Hope someone can help again because I'm really stumped......
10
by: ysfinks | last post by:
I compared view query plan with query plan if I run the same statement from view definition and get different results. View plan is more expensive...
9
by: Frawls | last post by:
Hi I Am am having problems with a stored Procedure that i wrote. Basically whats happening is that the Stored procedure Runs fine when i...
0
by: djflow | last post by:
Hi! II was wondering if you can help me with SQL query.. Below 7 separated select query works fine(only when they are retrieved separately) But...
8
by: mainframetech | last post by:
We are having a problem with Access 2002 as opposed to Access 2000. A multi-file query was set up under 2000 and tested good. Access is connected...
1
by: mrobinsc | last post by:
** This SQL statement returns 4 rows SELECT COUNT(*) G.ACTIVITY_ID G.RESOURCE_TYPE G.RESOURCE_CATEGORY ...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.