467,923 Members | 1,434 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

Ms Access database error."Could not update.Currently Locked"

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 Access database, I update a text type datafield of that record in Access database to 'Y' (to mark the perticular record as a copied record)(The program does the updation). I tested the program several times by using a seperate copy of the same database each time. Sometimes it worked ok. But randomly it gave an error "Could not update. Currently locked". Again some times it worked ok. I can't understand why this error comes at random times.
What is this error? How can I correct this?

The recordset opening method I used is :
rs.open sSQL , dbConn, adOpenStatic, adCmdTable

For some recordsets I used the method :
rs.open sSQL , dbConn , adOpenStatic, adLockOptimistic

rs:- the recordset
sSQL:- the SQL statement to select the records
dbConn:- the database connection

Is there something wrong with the recordset opening methods?

Can anyone please help me ......

Thanks,
amindi.
Aug 29 '06 #1
  • viewed: 7143
Share:
1 Reply
PEB
Expert 1GB
PEB
Hi,

Maybe if your code have already functionned maybe the problem isn't in your code
Maybe you open the database exclusively and one time opened the database is locked for others!

There is also a possibility for locking! If there is a problem with the ldb file of the database! If a suitable ldb file isn't created when the database is open you can't open it at the same time from other instances!

Have a nice luck!
Sep 2 '06 #2

Post your reply

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

Similar topics

2 posts views Thread by VB Programmer | last post: by
reply views Thread by =?Utf-8?B?eHl6X2phdA==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.