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

Could not Update currently lock by other session on this computer

134 100+
Hi, every time I run the below statement, it display error message "Could not Update , currently lock by other session in this computer.

I am running on a stand-alone PC.
Expand|Select|Wrap|Line Numbers
  1. Dim rst As New ADODB.Recordset, sqlstmt As String
  2.  
  3. sqlstmt = "SELECT * from tblvndprod where productID=" & Me.ProductID
  4.  
  5. rst.Open sqlstmt, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
  6.  
  7.  With rst
  8.     If Not .EOF Then
  9.     ![Unit] = Me.UnitMeasurement
  10.     .Update
  11.     End If
  12.  End With
  13.  
  14.    rst.Close
  15.    Set rst = Nothing
Dec 18 '07 #1
3 2160
jamesnkk
134 100+
Hi, every time I run the below statement, it display error message "Could not Update , currently lock by other session in this computer.

I am running on a stand-alone PC.

Dim rst As New ADODB.Recordset, sqlstmt As String

sqlstmt = "SELECT * from tblvndprod where productID=" & Me.ProductID

rst.Open sqlstmt, CurrentProject.Connection, adOpenDynamic, adLockOptimistic

With rst
If Not .EOF Then
![Unit] = Me.UnitMeasurement
.Update
End If
End With

rst.Close
Set rst = Nothing

I realize I have a tab control form which consist of Page 1 and Page 2.
If I do an update on Page 1, while Page 2 is open, error message occur.

Bit, If I remove Page 2, everything work well. Is there anyway I could temporary
disable or close the table on Page 2 without removing page 2 ?
Dec 19 '07 #2
NeoPa
32,556 Expert Mod 16PB
As a full member now, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use the tags in future.

ADMIN.
Dec 19 '07 #3
NeoPa
32,556 Expert Mod 16PB
Hi, every time I run the below statement, it display error message "Could not Update , currently lock by other session in this computer.

I am running on a stand-alone PC.
Expand|Select|Wrap|Line Numbers
  1. Dim rst As New ADODB.Recordset, sqlstmt As String
  2.  
  3. sqlstmt = "SELECT * from tblvndprod where productID=" & Me.ProductID
  4.  
  5. rst.Open sqlstmt, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
  6.  
  7.  With rst
  8.     If Not .EOF Then
  9.     ![Unit] = Me.UnitMeasurement
  10.     .Update
  11.     End If
  12.  End With
  13.  
  14.    rst.Close
  15.    Set rst = Nothing
The first thing that jumps out is that .Update is a DAO (not ADODB) function. Your Dim line declares the recordset as ADODB.
Also, a .Update must follow a .Edit. Your code has no visible .Edit.
The multi-page issue may well be a part of this also (seems likely) but clear away the obvious before trying to sort out the less so.
Dec 19 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Aaron Davies | last post by:
I'm developing a collaborative whiteboard, in which all objects (shapes, clip art icons, etc.) are synchronized between all participants in a session. It's working well, but I'm running into a...
1
by: Fie Fie Niles | last post by:
I have IIS installed on XP Professional workstation machine. I have an ASP page that open connection to an Access database, then when trying to update the database, it gave me the error "cannot...
3
by: Ray | last post by:
I am having my first experience using BLOB as a row in a table. I am using it to insert graphics for labels we print. I have no problem inserting into and select from the table. The graphic is...
2
by: Anastassios Giannaras | last post by:
Hello I have made an small access Database that is used by 4-5 people every day. Very often through the users get the message "Could Not Update; Currently Locked" There is an entry about that...
3
by: David W. Fenton | last post by:
A very old app of mine that's been in production use, and largely unchanged since about 1998 has started recently throwing error 3188 (can't update, locked by another session on this machine) when...
1
by: Mark Reed | last post by:
Hi All, I'm having a problem with the following code. I've read quite a lot of old posts regarding the issue but none seem to affer a solution. The scenario is. I have a bound form which...
4
by: misterutterbag | last post by:
Hi. Given the following: ---------------- String lockSubscriptionQuery = "SELECT subscriptionId FROM subscription WHERE subscriptionId = ? FOR UPDATE"; pStmt =...
0
by: Access Programming only with macros, no code | last post by:
ERROR MESSAGE: Could not update; currently locked by another session on this machine. BACKGROUND I have the following objects: Table1 - HO (which has about 51,000+ records) Table2 -...
4
by: jamesnkk | last post by:
Hi, I am using ADO, sometime I got an error message Could not update currently lock, and sometime I don;t . Error stop in last sentence "Rsumm.Update" , Before exit the program I have use...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
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
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
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...

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.