473,799 Members | 3,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Important Access Client/Server tip

I just got paid to solve this problem for one client, so I might be impeding
future business opportunities by sharing this secret, but a rising tide floats
all boats, so... I've seen this mysterious problem now in many Access C/S
applications. Usually some random GUI or workflow changes make the problem,
but for at least one of my clients, the problem was chronic.

You have an Access form bound to a linked SQL Server table. You try to save a
record from Access, and it hangs, possibly timing out with an error
eventually, or possibly until you kill Access or kill the connection from the
server-side (regardless of the timeout setting in Access). During this
lock-up, there is one SQL Server process blocking another - both intiated from
the same client workstation. The problem is usually intermittent, and hard to
reproduce.

Of course, if the 2 processes were blocking each other on the server-side, SQL
Server would detect that as a deadlock, and pick one of them to fail, but in
this case, it turns out we have process A (a SELECT query returning rows to
Access) blocking process B (an update) on the server, and Access hanging
waiting for process B before it will continue reading rows from process A,
thus allowing A to complete and stop blocking process B.

It turns out that process A is always the query for a combo box or list box,
and the answer turns out to be to always force combo and list boxes to
populate completely by reading the ListCount property immedately on form load,
and after every time a combo box is requeried or has its rowsource changed.
Presto - problem solved.
Nov 13 '05 #1
14 2190
Steve Jorgensen wrote:
I just got paid to solve this problem for one client, so I might be
impeding future business opportunities by sharing this secret, but a
rising tide floats all boats, so... I've seen this mysterious
problem now in many Access C/S applications. Usually some random GUI
or workflow changes make the problem, but for at least one of my
clients, the problem was chronic.

You have an Access form bound to a linked SQL Server table. You try
to save a record from Access, and it hangs, possibly timing out with
an error eventually, or possibly until you kill Access or kill the
connection from the server-side (regardless of the timeout setting in
Access). During this lock-up, there is one SQL Server process
blocking another - both intiated from the same client workstation.
The problem is usually intermittent, and hard to reproduce.

Of course, if the 2 processes were blocking each other on the
server-side, SQL Server would detect that as a deadlock, and pick one
of them to fail, but in this case, it turns out we have process A (a
SELECT query returning rows to Access) blocking process B (an update)
on the server, and Access hanging waiting for process B before it
will continue reading rows from process A, thus allowing A to
complete and stop blocking process B.

It turns out that process A is always the query for a combo box or
list box, and the answer turns out to be to always force combo and
list boxes to populate completely by reading the ListCount property
immedately on form load, and after every time a combo box is
requeried or has its rowsource changed. Presto - problem solved.


You can also specify NO LOCK if using a pass-through for the List/Combo and
that will also prevent the problem.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
On Tue, 15 Feb 2005 15:44:15 -0600, "Rick Brandt" <ri*********@ho tmail.com>
wrote:
Steve Jorgensen wrote:
I just got paid to solve this problem for one client, so I might be
impeding future business opportunities by sharing this secret, but a
rising tide floats all boats, so... I've seen this mysterious
problem now in many Access C/S applications. Usually some random GUI
or workflow changes make the problem, but for at least one of my
clients, the problem was chronic.

You have an Access form bound to a linked SQL Server table. You try
to save a record from Access, and it hangs, possibly timing out with
an error eventually, or possibly until you kill Access or kill the
connection from the server-side (regardless of the timeout setting in
Access). During this lock-up, there is one SQL Server process
blocking another - both intiated from the same client workstation.
The problem is usually intermittent, and hard to reproduce.

Of course, if the 2 processes were blocking each other on the
server-side, SQL Server would detect that as a deadlock, and pick one
of them to fail, but in this case, it turns out we have process A (a
SELECT query returning rows to Access) blocking process B (an update)
on the server, and Access hanging waiting for process B before it
will continue reading rows from process A, thus allowing A to
complete and stop blocking process B.

It turns out that process A is always the query for a combo box or
list box, and the answer turns out to be to always force combo and
list boxes to populate completely by reading the ListCount property
immedately on form load, and after every time a combo box is
requeried or has its rowsource changed. Presto - problem solved.


You can also specify NO LOCK if using a pass-through for the List/Combo and
that will also prevent the problem.


Where do you specify NO LOCK? Specifying "No Locks" on the form definitely
does not help.
Nov 13 '05 #3
"Rick Brandt" <ri*********@ho tmail.com> wrote in message
news:37******** *****@individua l.net...
Steve Jorgensen wrote:

You can also specify NO LOCK if using a pass-through for the List/Combo
and
that will also prevent the problem.


I can see two potential problems with using a NO LOCK hint. First, it's only
supported by SQL Server. Second, the resultset becomes read-only - so you
can't re-use the same procedure for a records-updating function later on.

Although it involves writing more code i think a better way might be to use
callback functions and a forward-only recordset to populate lists and combo
boxes.
Nov 13 '05 #4
On Tue, 15 Feb 2005 19:30:36 -0500, "John Winterbottom" <as******@hotma il.com>
wrote:
"Rick Brandt" <ri*********@ho tmail.com> wrote in message
news:37******* ******@individu al.net...
Steve Jorgensen wrote:

You can also specify NO LOCK if using a pass-through for the List/Combo
and
that will also prevent the problem.
I can see two potential problems with using a NO LOCK hint. First, it's only
supported by SQL Server. Second, the resultset becomes read-only - so you
can't re-use the same procedure for a records-updating function later on.


Ah - the lock hint. That may be OK because I've never seen this symptom with
other back-ends (only tried PostgreSQL), and the lock hint would be used in
stored procedures, so the results are read-only anyway with an MDB front-end.
Although it involves writing more code i think a better way might be to use
callback functions and a forward-only recordset to populate lists and combo
boxes.


Hmm - I had thought of that, and dismissed it as overengineering since getting
the ListCount works. Thinking more about it, though, I guess it doesn't
require any support code in the forms like the ListCount approach does, and is
not prone to code omission later.
Nov 13 '05 #5
Steve Jorgensen wrote:
Although it involves writing more code i think a better way might be to use
callback functions and a forward-only recordset to populate lists and combo
boxes.

I find callback functions painstakingly slow to populate a combo box,
the only time I've used them in the past is to poplate lists of tables
or forms in the database, it may be just that. But the thing is when
using the type down facility it appears to be running all that callback
code again and again. I've changed all those combos to now use a temp
table in the front end and populate that on form load, much improved.
Hmm - I had thought of that, and dismissed it as overengineering since getting
the ListCount works. Thinking more about it, though, I guess it doesn't
require any support code in the forms like the ListCount approach does, and is
not prone to code omission later.


I generally call a common function in the open event of every form,
something that then calls the ScaleForm from ADH so I'd put a common
function there to loop and do all combos. Only problem would be when
requerying later on.
--
This sig left intentionally blank
Nov 13 '05 #6
On Wed, 16 Feb 2005 08:17:48 +0000, Trevor Best <no****@besty.o rg.uk> wrote:

....
Hmm - I had thought of that, and dismissed it as overengineering since getting
the ListCount works. Thinking more about it, though, I guess it doesn't
require any support code in the forms like the ListCount approach does, and is
not prone to code omission later.


I generally call a common function in the open event of every form,
something that then calls the ScaleForm from ADH so I'd put a common
function there to loop and do all combos. Only problem would be when
requerying later on.


That's exactly what I am doing, and that's exactly the problem. Someone has
to search the app for cases of combo box requerying and rowsource assignment,
and fix each one. Then, everyone has to remember from then on to do the same
for any new cases that are introduced.

At least I was able to automate the process of inserting a call to a procedure
that fills all combo boxes on a form into the Form_Load handler of any form
that doesn't already have the procedure call.
Nov 13 '05 #7
Steve Jorgensen wrote:
On Tue, 15 Feb 2005 15:44:15 -0600, "Rick Brandt"
<ri*********@ho tmail.com> wrote:
You can also specify NO LOCK if using a pass-through for the
List/Combo and that will also prevent the problem.


Where do you specify NO LOCK? Specifying "No Locks" on the form
definitely does not help.


In a pass-through query to a SQL Server.

SELECT FieldName
FROM TableName (NOLOCK)

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #8
John Winterbottom wrote:
"Rick Brandt" <ri*********@ho tmail.com> wrote in message
news:37******** *****@individua l.net...
Steve Jorgensen wrote:

You can also specify NO LOCK if using a pass-through for the
List/Combo and
that will also prevent the problem.
I can see two potential problems with using a NO LOCK hint. First,
it's only supported by SQL Server. Second, the resultset becomes
read-only - so you can't re-use the same procedure for a
records-updating function later on.


Why would I care if the query used to populate a ListBox or CombBox was
editable?
Although it involves writing more code i think a better way might be
to use callback functions and a forward-only recordset to populate
lists and combo boxes.


I did this in a couple of cases where I was using a larger list to populate
the control than I am ordinarily comfortable with. If the list of rows is
small the entire set is likely to be pulled initially anyway. A Call-Back
on such a large set would perform terribly. Also the reason I don't like
the RowCount solution. It solves the problem by forcing all of the rows to
be pulled over the network. I see no reason to do that if I don't have to

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #9
On Wed, 16 Feb 2005 09:04:14 -0600, "Rick Brandt" <ri*********@ho tmail.com>
wrote:
John Winterbottom wrote:
"Rick Brandt" <ri*********@ho tmail.com> wrote in message
news:37******** *****@individua l.net...
Steve Jorgensen wrote:

You can also specify NO LOCK if using a pass-through for the
List/Combo and
that will also prevent the problem.
I can see two potential problems with using a NO LOCK hint. First,
it's only supported by SQL Server. Second, the resultset becomes
read-only - so you can't re-use the same procedure for a
records-updating function later on.


Why would I care if the query used to populate a ListBox or CombBox was
editable?
Although it involves writing more code i think a better way might be
to use callback functions and a forward-only recordset to populate
lists and combo boxes.


I did this in a couple of cases where I was using a larger list to populate
the control than I am ordinarily comfortable with. If the list of rows is
small the entire set is likely to be pulled initially anyway. A Call-Back


That doesn't match with my experience. One of the cases in which I
experienced the deadlock had to do with a 48-row table.
on such a large set would perform terribly. Also the reason I don't like
the RowCount solution. It solves the problem by forcing all of the rows to
be pulled over the network. I see no reason to do that if I don't have to


Nov 13 '05 #10

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

Similar topics

0
2466
by: DotNetJunkies User | last post by:
I am writing a distributed transaction code. My current scenario include a client database(Suppose client- having 4 main database) which can be installed anywhere which would connect to a public database placed at ISP datacentre(Suppose Server- having 2 database). this server database is added to client as linked server through vb.net interface. i have a transmission routine which transmitts the data from the client to Server and update client...
7
2045
by: wrytat | last post by:
Hi! I'm very new to ASP.NET and really need some good advice from experts here. I'm creating a web application for my company now. This application has 2 parts. 1 part for the customers to access. The 2nd part is for our staff to access only. My director hopes to make the 2nd part to be something like an intranet, such that only our company's computers (maybe only 1 or 2 in the company) can login to this part of the application. 1. My...
11
17064
by: Rosco | last post by:
Does anyone have a good URL or info whre Oracle and Access are compared to one another in performance, security, cost etc. Before you jump on me I know Oracle is a Cadillac compared to Access the Ford Fairlane. I need this info to complete a school project. Thanks.
6
4638
by: Lester Moreno | last post by:
Hello all, Up to now C# have been an great experience but I found myself in a end of the road problem. Let say that you have two windows program running on a local network area. User1 and user2 have the same information in the dataset and user1 makes a change, unless user2 refill all his tables in his dataset he can't see the
3
2664
by: Marc Gravell | last post by:
Kind of an open question on best-practice for smart-client design. I'd really appreciate anyones views (preferably with reasoning, but I'll take what I get...). Or if anybody has any useful links on the subject? (and yes, I have already googled it at length, but still no strong decision) ============= After a long stint of pure-desktop / pure-server applications, I'm currently working on a number of smart-client projects in C# using...
33
1900
by: Jeff | last post by:
I know this is a difficult one to answer, but I am interested in opinions on what hardware upgrades would be recommended with the following. Access 2000 running in a split config, but all in Terminal Server. Currently 15 users. This means that all files reside on the server and all processing happens there. Back-end is currently Access, but it will be upsized to SQL Server . So for this question assume SQL Server back-end. So what...
5
2917
by: B1ackwater | last post by:
We've fooled around with Access a bit, but only using the single-user store-bought version. It seems to be a good database - versatile and infinitely programmable - and can apparently be used as a front end to SQL server if we ever needed to go that route. But - is there a client/server version of Access ? Looking on the CDW site there is a bewildering variety of packages and licences and such, but we can't figure out just which do...
22
6290
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one client (MS Access vs ..NET Windows Forms) would be preferred over the other. While I have some good arguments on both sides, I would appreciate your points of view on the topic.
0
3845
by: shamirza | last post by:
· What is view state and use of it? The current property settings of an ASP.NET page and those of any ASP.NET server controls contained within the page. ASP.NET can detect when a form is requested for the first time versus when the form is posted (sent to the server), which allows you to program accordingly. · What are user controls and custom controls? Custom controls: A control authored by a user or a third-party software vendor that...
0
10260
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10243
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10030
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9078
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6809
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.