473,785 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Warn user-2 if user-1 on requested record

Using Access 2003 and using a form that's mostly bound. I need a way
to tell if user-1 is on the record when user-2 tries to open the same
record, w/o waiting for the user-1 to save the record first. The only
way I can think of is by adding a flag to the record and setting it to
true when user-1 opens the record. If user-2 tries to open it, the
flag is checked for true, then a message would be displayed to them
that user-1 is on the record. When user-1 saves the record, then the
flag is set to false.

Is this a good way to do this? Thanks for any help or advice.
Sep 16 '08
19 4030
On Sep 17, 12:06*pm, lyle fairfield <lylef...@yah00 .cawrote:
I give up.

Rich P <rpng...@aol.co mwrote innews:k8****** ***********@new sfe04.iad:


In theory, if referential integrity is set and keys are set then if
user1 edits/updates data this user will get an error message from the
sql server if the business rules are not met - usually some key
violation error. *Lets say user1 edits/updates data and then user2
edits/updates the same data 1 millisecond after user1 using the method
I
suggested. *If user2 is following the company's business rules and
enters the same data then this user will likely get some key violation
message of duplicate data - the record already exists. *But if user2 is
actually changing the data that User1 just edited - meaning user2 came
along after user1 - say an hour later - it doesn't matter if my method
is used or if User2 edits the data directly in the table.
The problem with Access here is that Access just can't read most of the
error messages from the sql server. *It just can't. *Slice it/dice it -
argue till you are blue in the face - Access can only read about 20-30
%
of error messages from the sql server. *I have had debates with other
Access people inhouse at my place who insisted that I was wrong. *To
date - no one has been able to show otherwise. *.Net on the otherhand,
is the new generation of technology which includes sql server
interactivity and has specifically addressed these issues successfully
- 100%. *
Bottom line - Access is a great tool - but against a sql server backend
- must proceed with great caution. *It is all doable - just a lot of
advanced functionality is not available in Access for dealing with sql
servers. *So I guess my method does not really present any advantages
over editing/updating data directly from the table. *Except if
migration
to .Net is in the works - this method will at least get you started
using the .Net paradigm.
Rich
*** Sent via Developersdexht tp://www.developersd ex.com***

--
-
lyle fairfield- Hide quoted text -

- Show quoted text -
So my original thought of setting a flag to a value on a record when
user-1 selects that record is not a good idea? I don't see how to set
the isolation level using VBA and it appears that it's used for
transaction processing only.
Sep 17 '08 #11
rkc
On Sep 17, 1:06*pm, lyle fairfield <lylef...@yah00 .cawrote:
I give up.
20 to 30% give up or 100% give up?
Sep 17 '08 #12
rkc <rk*@rkcny.comw rote in news:d5b80436-5d99-4e05-a702-
86**********@c6 5g2000hsa.googl egroups.com:
On Sep 17, 1:06*pm, lyle fairfield <lylef...@yah00 .cawrote:
>I give up.

20 to 30% give up or 100% give up?
I could never 100% give up on anyone.
My [Give-Up to Rich] ratio joins my [Give-Up to a Bucket of Rocks] ratio at
99.44%.

--
-
lyle fairfield
Sep 18 '08 #13
rkc
On Sep 18, 7:08*am, lyle fairfield <lylef...@yah00 .cawrote:
rkc <r...@rkcny.com wrote in news:d5b80436-5d99-4e05-a702-
86321a915...@c6 5g2000hsa.googl egroups.com:
On Sep 17, 1:06*pm, lyle fairfield <lylef...@yah00 .cawrote:
I give up.
20 to 30% give up or 100% give up?

I could never 100% give up on anyone.
My [Give-Up to Rich] ratio joins my [Give-Up to a Bucket of Rocks] ratio at
99.44%.
Hope is alive.
Sep 18 '08 #14
"Chris O'C via AccessMonster.c om" <u29189@uwewrot e in
news:8a4a590139 c8b@uwe:
I don't think you'll see any effect on the SQL Server tables when
"edited record" is selected, because it's a setting that applies to
Jet tables if the db was opened with row level locking set.
Are you suggesting that

MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to No Locks

and

MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to Edited Record

behave in the same way when updating data that has been changed subsequent
to loading the data into the form?

This is not the case.

---------------------------
No Locks lets me change the data regardless of a whether or not it has been
changed extraneously.
---------------------------

Edited Record gives me this warning message when the data has been changed
extraneously:

---------------------------
---------------------------
Microsoft Office Access
---------------------------
The data has been changed.
Another user edited this record and saved the changes before you attempted
to save you changes.
Re-edit the record.
---------------------------
OK
---------------------------
---------------------------

Reversing the process, that is trying to change the record in Microsoft SQL
Server Management Studio after having made a change in Access-ODBC gives:

---------------------------
---------------------------
Microsoft SQL Server Management Studio
---------------------------
Data has changed since the Results pane was last retrieved. Do you want to
save your changes now?
(Optimistic Concurrency Control Error)

Click Yes to commit your changes to database anyway.
Click No to discard your change and retrieve the current data for this row.
Click Cancel to continue editing.
---------------------------
Yes No Cancel Help
---------------------------
---------------------------

As an aside, I prefer the ADP handling of the situation which gives:

---------------------------
---------------------------
Write Conflict
---------------------------
This record has been changed by another user since you started editing it.
If you save the record, you will overwrite the changes the other user made.

Copying the changes to the clipboard will let you look at the values the
other user entered, and then paste your changes back in if you decide to
make changes.
---------------------------
Save Record Copy to Clipboard Drop Changes
---------------------------
---------------------------

--
lyle fairfield
Sep 18 '08 #15
No, when the op posted the question, he/she was using Access 2003, so I said
"use locks on edited record" and he/she said "I'm really using SQL Server 7"
and I said "I don't think a setting for Jet is going to do jack on SQL Server
tables".

Chris
Microsoft MVP
lyle fairfield wrote:
>I don't think you'll see any effect on the SQL Server tables when
"edited record" is selected, because it's a setting that applies to
Jet tables if the db was opened with row level locking set.

Are you suggesting that

MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to No Locks

and

MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to Edited Record

behave in the same way when updating data that has been changed subsequent
to loading the data into the form?

This is not the case.
--
Message posted via http://www.accessmonster.com

Sep 18 '08 #16
On Sep 18, 6:51*am, "Chris O'C via AccessMonster.c om" <u29189@uwe>
wrote:
No, when the op posted the question, he/she was using Access 2003, so I said
"use locks on edited record" and he/she said "I'm really using SQL Server7"
and I said "I don't think a setting for Jet is going to do jack on SQL Server
tables".

Chris
Microsoft MVP

lyle fairfield wrote:
I don't think you'll see any effect on the SQL Server tables when
"edited record" is selected, because it's a setting that applies to
Jet tables if the db was opened with row level locking set.
Are you suggesting that
MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to No Locks
and
MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to Edited Record
behave in the same way when updating data that has been changed subsequent
to loading the data into the form?
This is not the case.

--
Message posted viahttp://www.accessmonst er.com- Hide quoted text -

- Show quoted text -
I want user-2 notified that user-1 is in the record as soon as user-2
requests the record. The only way I see to do this is with a flag on
the record. I don't want to handle the write-conflict error at all.
Sep 18 '08 #17

<em******@kumc. eduwrote in message
news:5d******** *************** ***********@a1g 2000hsb.googleg roups.com...
On Sep 18, 6:51 am, "Chris O'C via AccessMonster.c om" <u29189@uwe>
wrote:
No, when the op posted the question, he/she was using Access 2003, so I
said
"use locks on edited record" and he/she said "I'm really using SQL Server
7"
and I said "I don't think a setting for Jet is going to do jack on SQL
Server
tables".

Chris
Microsoft MVP

lyle fairfield wrote:
I don't think you'll see any effect on the SQL Server tables when
"edited record" is selected, because it's a setting that applies to
Jet tables if the db was opened with row level locking set.
Are you suggesting that
MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to No Locks
and
MS-Access (2007)
ODBC
MS-SQL Server
Bound Form with Record Locks set to Edited Record
behave in the same way when updating data that has been changed
subsequent
to loading the data into the form?
This is not the case.

--
Message posted viahttp://www.accessmonst er.com- Hide quoted text -

- Show quoted text -
>I want user-2 notified that user-1 is in the record as soon as user-2
requests the record. The only way I see to do this is with a flag on
the record. I don't want to handle the write-conflict error at all.
Have your form attempt to place a write lock on the record when opened. If
the lock fails, user-1 has it opened, display a message to User-2 and return
to the previous record. When User-1 exits the record, have the form release
the lock.
Sep 18 '08 #18
On Sep 18, 4:28*pm, "paii, Ron" <n...@no.comwro te:
<emann...@kumc. eduwrote in message

news:5d******** *************** ***********@a1g 2000hsb.googleg roups.com...
On Sep 18, 6:51 am, "Chris O'C via AccessMonster.c om" <u29189@uwe>
wrote:


No, when the op posted the question, he/she was using Access 2003, so I
said
"use locks on edited record" and he/she said "I'm really using SQL Server
7"
and I said "I don't think a setting for Jet is going to do jack on SQL
Server
tables".
Chris
Microsoft MVP
lyle fairfield wrote:
>I don't think you'll see any effect on the SQL Server tables when
>"edited record" is selected, because it's a setting that applies to
>Jet tables if the db was opened with row level locking set.
>Are you suggesting that
>MS-Access (2007)
>ODBC
>MS-SQL Server
>Bound Form with Record Locks set to No Locks
>and
>MS-Access (2007)
>ODBC
>MS-SQL Server
>Bound Form with Record Locks set to Edited Record
>behave in the same way when updating data that has been changed
subsequent
>to loading the data into the form?
>This is not the case.
--
Message posted viahttp://www.accessmonst er.com-Hide quoted text -
- Show quoted text -
I want user-2 notified that user-1 is in the record as soon as user-2
requests the record. *The only way I see to do this is with a flag on
the record. *I don't want to handle the write-conflict error at all.

Have your form attempt to place a write lock on the record when opened. If
the lock fails, user-1 has it opened, display a message to User-2 and return
to the previous record. When User-1 exits the record, have the form release
the lock.- Hide quoted text -

- Show quoted text -
How do I set a write lock on a record? I'm not seeing anything in
newgroups or my Access manual about how to set a write lock. There is
a Record Locks property on the form which is set to Edited Record.
But according to Chris (above), this doesn't apply to linked SQL
tables.
Sep 19 '08 #19

<em******@kumc. eduwrote in message
news:d3******** *************** ***********@t54 g2000hsg.google groups.com...
On Sep 18, 4:28 pm, "paii, Ron" <n...@no.comwro te:
<emann...@kumc. eduwrote in message

news:5d******** *************** ***********@a1g 2000hsb.googleg roups.com...
On Sep 18, 6:51 am, "Chris O'C via AccessMonster.c om" <u29189@uwe>
wrote:


No, when the op posted the question, he/she was using Access 2003, so I
said
"use locks on edited record" and he/she said "I'm really using SQL
Server
7"
and I said "I don't think a setting for Jet is going to do jack on SQL
Server
tables".
Chris
Microsoft MVP
lyle fairfield wrote:
>I don't think you'll see any effect on the SQL Server tables when
>"edited record" is selected, because it's a setting that applies to
>Jet tables if the db was opened with row level locking set.
>Are you suggesting that
>MS-Access (2007)
>ODBC
>MS-SQL Server
>Bound Form with Record Locks set to No Locks
>and
>MS-Access (2007)
>ODBC
>MS-SQL Server
>Bound Form with Record Locks set to Edited Record
>behave in the same way when updating data that has been changed
subsequent
>to loading the data into the form?
>This is not the case.
--
Message posted viahttp://www.accessmonst er.com-Hide quoted text -
- Show quoted text -
I want user-2 notified that user-1 is in the record as soon as user-2
requests the record. The only way I see to do this is with a flag on
the record. I don't want to handle the write-conflict error at all.

Have your form attempt to place a write lock on the record when opened. If
the lock fails, user-1 has it opened, display a message to User-2 and
return
to the previous record. When User-1 exits the record, have the form
release
the lock.- Hide quoted text -

- Show quoted text -
>How do I set a write lock on a record? I'm not seeing anything in
newgroups or my Access manual about how to set a write lock. There is
a Record Locks property on the form which is set to Edited Record.
But according to Chris (above), this doesn't apply to linked SQL
tables.

I have never done it, but look at DAO or ADO record sets. You may need to
use an unbound form.
Sep 19 '08 #20

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

Similar topics

5
18887
by: Jamie Jackson | last post by:
I've got a form that's nested in a larger application. I need to program it so that the user is warned to save upon clicking on any exit point in the application. So, if they click on any of the nav buttons in the header/nav bar, they need to get an alert: "Would you like to continue without saving your changes?" _Yes_ _No_
65
3007
by: PengYu.UT | last post by:
Hi, Sometimes, I write = instead of == in if conditions by mistakes. Is there any way the gcc compiler can give me a warning? Best wishes, Peng
0
1093
by: Elmo Watson | last post by:
Why would my Trace.Warn statements be Red (as I expect them to be) in some pages, and only black in others?
2
2087
by: funkyj | last post by:
I've been googling around trying to find the answer to this question but all I've managed to turn up is a 2 year old post of someone else asking the same question (no answer though). http://groups.google.com/group/comp.lang.python/browse_frm/thread/8004c690b8c4db53/81e460a0ee8b03a5?lnk=st&q=python+warnings+echo&rnum=6#81e460a0ee8b03a5 jh> In the following jh> jh> import warnings jh> warnings.warn('change me')
89
6079
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
2
2590
by: tshad | last post by:
I have a page with Trace.Warns statements in my Page_Load and functions that it calls, but it doesn't seem to work in a class that is defined on the same page. I am writing this in C# I am getting the following error at the 1st Trace.Warn: *********************************************** Compiler Error Message: CS0118: 'System.Web.UI.Page.Trace' denotes a 'property' where a 'class' was expected
0
1496
by: Eric Sosman | last post by:
Tomás Ó hÉilidhe wrote: <digression> That's not just unspecified, it's undefined: It both modifies `p' and reads it (for a purpose other than computing the new value), without a sequence point between the two accesses. There's a sequence point between the evaluation of `*p' and the invocation of ConvertToLowercase(), and there's another sequence
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8971
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...
1
7496
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
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 we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2877
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.