Access VBA Timing Problem
-
We got a customer who uses a Access DBs with code inside - one DB with Forms and Modules, the second stores the data. Two users work together from their computers on those DBs stored in the network. Well, the devloper they had went into retirement. So I had the pleasure to port the Access 97/2000 DBs to 2003/2010. No there are some funny errors appearing just in their network not in our. I went to them cause I wasn't able to replicate those errors. Now it's even stranger. I tried to debug them, but they didn't appeared. I stopped debugging and the errors were thrown - not all the time but most times. Access messages that a record is locked by another user although I was the only one today working on the db. There are error-messages, that an update wasn't successful but the data is stored correctly, after leaving the form all data is correct when I open it again. It seems, that there is a timing / synchronisation error. I think the programm-code is faster than the operations in the data-db. But as debugging isn't possible it's hard to find the source. Is there a way for a better synchronisation? One user has Windows XP, the other one Windows 7 both use Access 2003 SP 3. Regards, Ingo
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
We got a customer who uses a Access DBs with code inside - one DB with Forms and Modules, the second stores the data. Two users work together from their computers on those DBs stored in the network. Well, the devloper they had went into retirement. So I had the pleasure to port the Access 97/2000 DBs to 2003/2010. No there are some funny errors appearing just in their network not in our. I went to them cause I wasn't able to replicate those errors. Now it's even stranger. I tried to debug them, but they didn't appeared. I stopped debugging and the errors were thrown - not all the time but most times. Access messages that a record is locked by another user although I was the only one today working on the db. There are error-messages, that an update wasn't successful but the data is stored correctly, after leaving the form all data is correct when I open it again. It seems, that there is a timing / synchronisation error. I think the programm-code is faster than the operations in the data-db. But as debugging isn't possible it's hard to find the source. Is there a way for a better synchronisation? One user has Windows XP, the other one Windows 7 both use Access 2003 SP 3. Regards, Ingo
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
Your first problem is your using Access. There is no "timing/synchronisation" problem as Access is all file based. This sounds as though they have a problem with the server that these files are hosted on. Though, without further information on the exact errors they're getting and the server O/S and network config, it's impossible to say. And, so far, this has nothing to do with Visual Basic at all.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Your first problem is your using Access. There is no "timing/synchronisation" problem as Access is all file based. This sounds as though they have a problem with the server that these files are hosted on. Though, without further information on the exact errors they're getting and the server O/S and network config, it's impossible to say. And, so far, this has nothing to do with Visual Basic at all.
A guide to posting questions on CodeProject[^]
Dave KreskowiakDave Kreskowiak wrote:
Your first problem is your using Access.
I'm not using Access. They use it and so I have to. So my problem is that they use Access.
Dave Kreskowiak wrote:
And, so far, this has nothing to do with Visual Basic at all.
Well I thought there was the chance to give more time per operation programmatically, as while I'm debugging - no error occurs. Thank you for your answer, Ingo
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
We got a customer who uses a Access DBs with code inside - one DB with Forms and Modules, the second stores the data. Two users work together from their computers on those DBs stored in the network. Well, the devloper they had went into retirement. So I had the pleasure to port the Access 97/2000 DBs to 2003/2010. No there are some funny errors appearing just in their network not in our. I went to them cause I wasn't able to replicate those errors. Now it's even stranger. I tried to debug them, but they didn't appeared. I stopped debugging and the errors were thrown - not all the time but most times. Access messages that a record is locked by another user although I was the only one today working on the db. There are error-messages, that an update wasn't successful but the data is stored correctly, after leaving the form all data is correct when I open it again. It seems, that there is a timing / synchronisation error. I think the programm-code is faster than the operations in the data-db. But as debugging isn't possible it's hard to find the source. Is there a way for a better synchronisation? One user has Windows XP, the other one Windows 7 both use Access 2003 SP 3. Regards, Ingo
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
If you have more than one process updating the same record at the same time you will get a record locking issue in Access. "Access messages that a record is locked by another user although I was the only one today working on the db." - how do you know that no other process was accessing the record(a lock is a lock and the only way this can happen is if another process has the record open)? There really is no way around this unless you find some way to take a copy of the record for each user but then you may encounter a merge issue when you then go and update the original record overwriting the previous users data. The first thing to do is to specifically isolate exactly when and why the record locking is occurring and take it from there.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
-
If you have more than one process updating the same record at the same time you will get a record locking issue in Access. "Access messages that a record is locked by another user although I was the only one today working on the db." - how do you know that no other process was accessing the record(a lock is a lock and the only way this can happen is if another process has the record open)? There really is no way around this unless you find some way to take a copy of the record for each user but then you may encounter a merge issue when you then go and update the original record overwriting the previous users data. The first thing to do is to specifically isolate exactly when and why the record locking is occurring and take it from there.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
GuyThiebaut wrote:
If you have more than one process updating the same record at the same time you will get a record locking issue in Access.
That's clear
GuyThiebaut wrote:
how do you know that no other process was accessing the record
Easy. The other users weren't there today. There was only one user on which pc I worked, there was no ldb-file before I started, the ldb-file was deleted everytime I closed.
GuyThiebaut wrote:
There really is no way around this unless you find some way to take a copy of the record for each user but then you may encounter a merge issue when you then go and update the original record overwriting the previous users data.
The different users work on different subjects which have own datarecords. The same records won't be opened by different users at the same time due to the workflow they use.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
We got a customer who uses a Access DBs with code inside - one DB with Forms and Modules, the second stores the data. Two users work together from their computers on those DBs stored in the network. Well, the devloper they had went into retirement. So I had the pleasure to port the Access 97/2000 DBs to 2003/2010. No there are some funny errors appearing just in their network not in our. I went to them cause I wasn't able to replicate those errors. Now it's even stranger. I tried to debug them, but they didn't appeared. I stopped debugging and the errors were thrown - not all the time but most times. Access messages that a record is locked by another user although I was the only one today working on the db. There are error-messages, that an update wasn't successful but the data is stored correctly, after leaving the form all data is correct when I open it again. It seems, that there is a timing / synchronisation error. I think the programm-code is faster than the operations in the data-db. But as debugging isn't possible it's hard to find the source. Is there a way for a better synchronisation? One user has Windows XP, the other one Windows 7 both use Access 2003 SP 3. Regards, Ingo
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
It's not "timing problem". It's Access database synchronization problem. Client stores copy of data as long as synchronization will be possible. Please, refer these: Page-level locking vs. record-level locking[^] about sharing an access database on a network[^] set options for a shared access database[^] help access run faster[^]
-
It's not "timing problem". It's Access database synchronization problem. Client stores copy of data as long as synchronization will be possible. Please, refer these: Page-level locking vs. record-level locking[^] about sharing an access database on a network[^] set options for a shared access database[^] help access run faster[^]
Thanks for your answer. To my sorrow these settings are all properly done. I checked them already.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
Dave Kreskowiak wrote:
Your first problem is your using Access.
I'm not using Access. They use it and so I have to. So my problem is that they use Access.
Dave Kreskowiak wrote:
And, so far, this has nothing to do with Visual Basic at all.
Well I thought there was the chance to give more time per operation programmatically, as while I'm debugging - no error occurs. Thank you for your answer, Ingo
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
ihoecken wrote:
I'm not using Access. They use it and so I have to. So my problem is that they use Access.
Again, without the error messages, it's pretty impossible to tell you what's going on. But, with all the problems you're having, this is why you don't see very many multi-user Access applications.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
GuyThiebaut wrote:
If you have more than one process updating the same record at the same time you will get a record locking issue in Access.
That's clear
GuyThiebaut wrote:
how do you know that no other process was accessing the record
Easy. The other users weren't there today. There was only one user on which pc I worked, there was no ldb-file before I started, the ldb-file was deleted everytime I closed.
GuyThiebaut wrote:
There really is no way around this unless you find some way to take a copy of the record for each user but then you may encounter a merge issue when you then go and update the original record overwriting the previous users data.
The different users work on different subjects which have own datarecords. The same records won't be opened by different users at the same time due to the workflow they use.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
Thanks - I think the only way I would be able to help was if I was sitting next to you when this happens. What I would say is to keep a note of the the tables this happens on - this will be the clue. Also check to see if there are any triggers on tables being updated which may be causing an issue to.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
-
ihoecken wrote:
I'm not using Access. They use it and so I have to. So my problem is that they use Access.
Again, without the error messages, it's pretty impossible to tell you what's going on. But, with all the problems you're having, this is why you don't see very many multi-user Access applications.
A guide to posting questions on CodeProject[^]
Dave KreskowiakThere are no error messages that state the problem. There are different messages "error 3020 on tblXY Update or CancelUpdate without Addnew or edit" There is always an addnew or edit and there is the error-message but the data is stored properly. The error isn't thrown when I go step-by-step through the code with debugging. The error isn't thrown here at my work in our network. There are other errors, too. (record is locked by other user, but there was no other user today, when the error was thrown). All errors disappear while debugging and sometime during the normal work, too.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
Thanks - I think the only way I would be able to help was if I was sitting next to you when this happens. What I would say is to keep a note of the the tables this happens on - this will be the clue. Also check to see if there are any triggers on tables being updated which may be causing an issue to.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
GuyThiebaut wrote:
Thanks - I think the only way I would be able to help was if I was sitting next to you when this happens.
Well thank you for your answer. It's totally strange. I never saw such a problem although in former times I had to build some access solutions.
GuyThiebaut wrote:
Also check to see if there are any triggers on tables being updated which may be causing an issue to.
Are triggers available before Access 2010? Well I didn't looked at them cause I thought they weren't , I will do it tomorrow. Thank you.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
GuyThiebaut wrote:
Thanks - I think the only way I would be able to help was if I was sitting next to you when this happens.
Well thank you for your answer. It's totally strange. I never saw such a problem although in former times I had to build some access solutions.
GuyThiebaut wrote:
Also check to see if there are any triggers on tables being updated which may be causing an issue to.
Are triggers available before Access 2010? Well I didn't looked at them cause I thought they weren't , I will do it tomorrow. Thank you.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
ihoecken wrote:
Are triggers available before Access 2010
No, Access (I should say Jet or ACE) doesn't support Triggers.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
There are no error messages that state the problem. There are different messages "error 3020 on tblXY Update or CancelUpdate without Addnew or edit" There is always an addnew or edit and there is the error-message but the data is stored properly. The error isn't thrown when I go step-by-step through the code with debugging. The error isn't thrown here at my work in our network. There are other errors, too. (record is locked by other user, but there was no other user today, when the error was thrown). All errors disappear while debugging and sometime during the normal work, too.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
I would start by reading up as much as you can after you Google for "Access error 3020". I have no idea if any of the situations or solutions applies to your situation, but it's a start.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
We got a customer who uses a Access DBs with code inside - one DB with Forms and Modules, the second stores the data. Two users work together from their computers on those DBs stored in the network. Well, the devloper they had went into retirement. So I had the pleasure to port the Access 97/2000 DBs to 2003/2010. No there are some funny errors appearing just in their network not in our. I went to them cause I wasn't able to replicate those errors. Now it's even stranger. I tried to debug them, but they didn't appeared. I stopped debugging and the errors were thrown - not all the time but most times. Access messages that a record is locked by another user although I was the only one today working on the db. There are error-messages, that an update wasn't successful but the data is stored correctly, after leaving the form all data is correct when I open it again. It seems, that there is a timing / synchronisation error. I think the programm-code is faster than the operations in the data-db. But as debugging isn't possible it's hard to find the source. Is there a way for a better synchronisation? One user has Windows XP, the other one Windows 7 both use Access 2003 SP 3. Regards, Ingo
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
There is one more source of problems in customer installations: they use some kind of virus scanner. And such a virus scanner might block the access database file for a moment when data are changed (because the file contents are changed). When you debug step by step, the virus scanner can finish its job before the next request is done, but in production code the time span is too small. I'd suggest to remove the database file from the virus scanners's tasks.
-
There is one more source of problems in customer installations: they use some kind of virus scanner. And such a virus scanner might block the access database file for a moment when data are changed (because the file contents are changed). When you debug step by step, the virus scanner can finish its job before the next request is done, but in production code the time span is too small. I'd suggest to remove the database file from the virus scanners's tasks.
Good idea, thanks. I will talk with them about that. :-\
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.
-
I would start by reading up as much as you can after you Google for "Access error 3020". I have no idea if any of the situations or solutions applies to your situation, but it's a start.
A guide to posting questions on CodeProject[^]
Dave KreskowiakWell, I do. It's just hard to test any possible solution as the errors don't occur in our environment. Thank you for your time.
------------------------------ Author of Primary ROleplaying SysTem How do I take my coffee? Black as midnight on a moonless night. War doesn't determine who's right. War determines who's left.