![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all I once wrote about my problem "Could not update; currently locked" http://groups.google.com/group/comp....53b984344 234 The problem is, that there is a saver, cashing data, and a summariser which goes though data for the last half our and put them in another table. There are 2 threads doing this, but they cannot work at the same time. If I save data every 20 ms, then the "Could not update; currently locked" error occurs. AFAIK it should be possible for multiple users to access one *.mdb file - or am I wrong? I attach some code here, it that helps. CoInitialize(nil); FConnection := CreateOleObject('ADODB.Connection') as _Connection; FConnection.CursorLocation := adUseServer; { Client if you need to use recordcount!!!! } FConnection.Open('Data Source=' + FDatabaseName, FUsername, FPassword, 0); FRecordset := CreateOleObject('ADODB.Recordset') as _RecordSet; var FRecordset.Open(sSQL, FConnection, adOpenForwardOnly, adLockReadOnly, adCmdText); and... FConnection.Execute(sSQL, aI, 0); // this fails sometimes, if the threads by accident works at the same time, even that they are working on different tables. WBR Sonnich |
#3
| |||
| |||
|
|
On Wed, 22 Apr 2009 09:51:24 -0700 (PDT), jodleren <sonn... (AT) hot (DOT) ee wrote: You don't give a lot of information, but to me it seems running some query every 20 ms (that's milliseconds) is insane. Copying the data to another table is a violation of relational database design principles. You may want to re-think your application and database design first. -Tom. Microsoft Access MVP Hi all I once wrote about my problem "Could not update; currently locked" http://groups.google.com/group/comp..../browse_thread... The problem is, that there is a saver, cashing data, and a summariser which goes though data for the last half our and put them in another table. There are 2 threads doing this, but they cannot work at the same time. If I save data every 20 ms, then the "Could not update; currently locked" error occurs. AFAIK it should be possible for multiple users to access one *.mdb file - or am I wrong? I attach some code here, it that helps. *CoInitialize(nil); *FConnection := CreateOleObject('ADODB.Connection') as _Connection; *FConnection.CursorLocation := adUseServer; { Client if you need to use recordcount!!!! } *FConnection.Open('Data Source=' + FDatabaseName, FUsername, FPassword, 0); *FRecordset := CreateOleObject('ADODB.Recordset') as _RecordSet; var *FRecordset.Open(sSQL, FConnection, adOpenForwardOnly, adLockReadOnly, adCmdText); and... *FConnection.Execute(sSQL, aI, 0); // this fails sometimes, if the threads by accident works at the same time, even that they are working on different tables. WBR Sonnich |
#4
| |||
| |||
|
|
Hi all I once wrote about my problem "Could not update; currently locked"http://groups.google.com/group/comp.databases.ms-access/browse_thread... The problem is, that there is a saver, cashing data, and a summariser which goes though data for the last half our and put them in another table. There are 2 threads doing this, but they cannot work at the same time. If I save data every 20 ms, then the "Could not update; currently locked" error occurs. AFAIK it should be possible for multiple users to access one *.mdb file - or am I wrong? I attach some code here, it that helps. * CoInitialize(nil); * FConnection := CreateOleObject('ADODB.Connection') as _Connection; * FConnection.CursorLocation := adUseServer; { Client if you need to use recordcount!!!! } * FConnection.Open('Data Source=' + FDatabaseName, FUsername, FPassword, 0); * FRecordset := CreateOleObject('ADODB.Recordset') as _RecordSet; var * FRecordset.Open(sSQL, FConnection, adOpenForwardOnly, adLockReadOnly, adCmdText); and... * FConnection.Execute(sSQL, aI, 0); // this fails sometimes, if the threads by accident works at the same time, even that they are working on different tables. WBR Sonnich |
#5
| |||
| |||
|
|
Is it a big secret as to what application you might be using? Maybe Pythia could tell us? |
#6
| |||
| |||
|
|
Is it a big secret as to what application you might be using? Maybe Pythia could tell us? |
![]() |
| Thread Tools | |
| Display Modes | |
| |