473,320 Members | 2,083 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,320 software developers and data experts.

-2147217887 Could not update; Currently Locked

Have a vb6 program that was connecting to an Access 97 database. We have converted the database to Access 2003 and changed the provider to use Jet 4.0

Now we are running into Could not update; Currently Locked when we are trying to add records to a table. Here is the code inserting records into the database. It works 95% of the time but if we are inserting a lot of data, it starts to get record locks.

Public Sub Store(Conn As ADODB.Connection, Day As Date, _
nType As cNodeType, ID As Long, Name As String, _
Origin As String, Location As String, Forecast As Variant)

Dim Stored As New ADODB.Recordset
Dim i As Integer
Dim iReSave As Boolean
On Error GoTo ErrorOnSave

Stored.Open "forecasts", _
Conn, adOpenStatic, adLockOptimistic


Stored.AddNew
Stored!Updated = Now
Stored!Date = Day
Stored!Type = nType
Stored!ID = ID
Stored!Name = Name
Stored!Origin = Origin
Stored!Location = Location

For i = 0 To 95
Stored.Fields(i + 7).Value = Forecast(i, 0)
Next

Stored.Update
Stored.Close
End Sub
Sep 9 '06 #1
1 4734
PEB
1,418 Expert 1GB
Have a vb6 program that was connecting to an Access 97 database. We have converted the database to Access 2003 and changed the provider to use Jet 4.0

Now we are running into Could not update; Currently Locked when we are trying to add records to a table. Here is the code inserting records into the database. It works 95% of the time but if we are inserting a lot of data, it starts to get record locks.

Public Sub Store(Conn As ADODB.Connection, Day As Date, _
nType As cNodeType, ID As Long, Name As String, _
Origin As String, Location As String, Forecast As Variant)

Dim Stored As New ADODB.Recordset
Dim i As Integer
Dim iReSave As Boolean
On Error GoTo ErrorOnSave

Stored.Open "forecasts", _
Conn, adOpenStatic, adLockOptimistic


Stored.AddNew
Stored!Updated = Now
Stored!Date = Day
Stored!Type = nType
Stored!ID = ID
Stored!Name = Name
Stored!Origin = Origin
Stored!Location = Location

For i = 0 To 95
Stored.Fields(i + 7).Value = Forecast(i, 0)
Next

Stored.Update
Stored.Close
End Sub
Hi,

Do you use the database in shared mode?

Have you checked the settings of the connection?

There is a lot of network properties that have to be set like ODBC timeout
ODBC refresh

Number of locks per page and so on that have to be checked in the Access database...

Locked records per page

So please search for them in Ms access help... Maybe you have to change some property...


Have a nice day

:)
Sep 9 '06 #2

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

Similar topics

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...
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...
1
by: G Gerard | last post by:
Hello I am running an application created with MSAccess XP on a Novell server. Every few days the backend database locks up; when a user tries to update the backend, the following error message...
2
by: gordonjones | last post by:
I have users on different computers getting the error message "could not update;currently locked" when trying to leave identical fields after making a change on the same form but on different...
1
by: amindi | last post by:
Hi, I wrote a VB6 program to read some data records from a Ms Access database and to write them into a SQL server database.(I use Ms Access 2000 and SQL server 2000).After reading each record in...
1
by: G Gerard | last post by:
Hello I am running an application created with MSAccess XP . This application is running on a server and has many users. Sometimes the backend database (MSAccess MDB) locks up When a user tries...
2
by: CWogksch | last post by:
Hello, Everyone... My name is Chris Wogksch. I have a point of sale application developed in VB6 using MS Access 2003 as the database. I've been running versions of this app for over eight...
0
by: CWogksch | last post by:
Hello, Everyone... My name is Chris Wogksch. I have a point of sale application developed in VB6 using MS Access 2003 as the database. I've been running versions of this app for over eight...
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 -...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.