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

Record Lock of Code problem?

Hi,

It's single user .mdb (for now).
i've created a generic form for a user to add a note to existing note
in a memo Note field in a table (myTbl). The relevant part of the
code:

'
NoteText = ExsntNote & Chr(13) & Chr(10) & Date & " (" & GetUserName &
") " & NoteText

strSQL = "UPDATE " & myTbl & " SET " & myField & " = '" & NoteText & _
"' WHERE " & myIDField & " = " & myID

CurrentDb.Execute strSQL, dbFailOnError 'Adds the note to the target
field

'

So, all the above does is it takes the ExsntNote (current note in the
memo field), adds line feeder &Return, date, usrename and the new
note. the structute of "NoteText = ....NoteText" is because the new
NoteText is actually coming from a different form. This all is just to
not let the user remove/edit existing note but just to add new notes
to the existing one but still store all of the notes in a single notes
memo field (i.e., not multiple records).
The code works fine untill it reaches certain limit (seems to be
around 3000 characters) - then it runs into record lock error:
"3188,
Could not Update; currenlty locked by another session on this
machine."

So, i was hoping that you could advise whether the code has reached
some kind of memory limits or any other limit and how to overcome the
promlem if i were to stick with the structure where the notes are
still stored in one record instead of being added as new records (rows
in the table) each time.

Thanks!
Feb 28 '08 #1
2 2581
Hi

On a side note, you could use the standard 'vbCrLf' instead of the 'Chr(13)
& Chr(10)'. Much easier to remember and read.

You'd probably be best to consider having a separate table (maybe called
mySubTbl) for all these additional notes, one that will reference with a
Foriegn Key to your 'myTbl' Primary Key. Using a Subform to add these
notes will make the development simple.
Dom
"austris" <au*****************@gmail.comwrote in message
news:e4**********************************@d21g2000 prf.googlegroups.com...
Hi,

It's single user .mdb (for now).
i've created a generic form for a user to add a note to existing note
in a memo Note field in a table (myTbl). The relevant part of the
code:

'
NoteText = ExsntNote & Chr(13) & Chr(10) & Date & " (" & GetUserName &
") " & NoteText

strSQL = "UPDATE " & myTbl & " SET " & myField & " = '" & NoteText & _
"' WHERE " & myIDField & " = " & myID

CurrentDb.Execute strSQL, dbFailOnError 'Adds the note to the target
field

'

So, all the above does is it takes the ExsntNote (current note in the
memo field), adds line feeder &Return, date, usrename and the new
note. the structute of "NoteText = ....NoteText" is because the new
NoteText is actually coming from a different form. This all is just to
not let the user remove/edit existing note but just to add new notes
to the existing one but still store all of the notes in a single notes
memo field (i.e., not multiple records).
The code works fine untill it reaches certain limit (seems to be
around 3000 characters) - then it runs into record lock error:
"3188,
Could not Update; currenlty locked by another session on this
machine."

So, i was hoping that you could advise whether the code has reached
some kind of memory limits or any other limit and how to overcome the
promlem if i were to stick with the structure where the notes are
still stored in one record instead of being added as new records (rows
in the table) each time.

Thanks!

Feb 28 '08 #2
Thanks Dom!
I even didn't know that there was that standard line feeder (proving
how little i know...).
I kind-of worked around my problem by releasing the record from the
row but it's not a good solution though so i just might have to follow
your advise to split the memos up into multiple records vs one.

Thanks again for response.
Mar 1 '08 #3

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

Similar topics

8
by: Komandur Kannan | last post by:
We have a smart device application running on handhelds(Symbol MC9000G). The backend is Oracle and a middle tier web services development done in Vb.net. We use pessimistic Locking due to...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
19
by: rich | last post by:
I am building an app using php and postgresql. My questionis this. How do you handle people wanting to make parallel changes to a record. Since in web apps you are doing a select, bring over a...
9
by: master | last post by:
Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database with, say 10000 records with some unvalidated...
3
by: HDI | last post by:
Hi, I'm writing a windows application where users can update records but how can I lock a record when a user opens it. With ado and vb6 you can lock the opened record but with ado.net I...
2
by: brino | last post by:
hi all ! i have a data entry form and the problem i have is that the users when they are entering data in grab the mouse and accidently move the roller on the mouse and move to a new record on...
5
by: payffl | last post by:
My users are running Access '03. They have a database with a form that allows them to enter new records. Frequently they will move to a new record and not enter any information. This prevents...
3
by: David C. Barber | last post by:
How do you lock a record in SQL Server from ASP 2? I need to read the record, allow the user to edit it, and then have them click Save and rewrite it. Obviously I don't want anyone else getting...
5
by: prakashwadhwani | last post by:
The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in my form were working perfectly. However, after I added a call to the "Save_Fields_In_Form_Header" Event/Proc in the...
19
by: emanning | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.