My company uses a shared MS Access database, with a back end stored on a server and a front end copied onto users desktops.
Recently, our IT department moved us to a new server without giving us any notice, and now our database keeps crashing.
Every 20-40 minutes, users get an error message that says:
Error 3043 Your network access was interrupted. To continue, close the database, and then open it again.
If they close and reopen, it does work. However, I'd like to stop this from happening, since it typically happens when they are in the middle of something and have to re-do everything.
I've already spoken with our IT consultants and they see no issue with our server/network, nor do they know anything about Access and therefore are no help.
Does anyone have any experience with this or have any ideas that may help me repair my database?
Thanks in advance.
Here are some thoughts:
It sounds very much like (short) network interruptions. MS Access doesn't like these at all, in particular it doesn't recover from a broken connection (even if very short) until you restart the frontend.
Network interruptions during write operations on Access backends are the prime cause of backend database corruption. Consider yourself lucky if you haven't experienced that yet. But you should backup and Compact&Repair the backend often (!) .
You can prevent backend corruptions by moving the backend to a server database, e.g. SQL Server Express (free). Errors will still occur ("ODBC call failed" instead of error 3043), but they will only affect the frontends.
You can probably work around all errors by changing the frontend from bound forms to unbound forms. This is a major undertaking.
I don't think there is anything you can do with the backend to prevent the errors.
If this database has value to your company, and IT says there is no problem, I suggest you escalate the problem to someone who can make IT look closer into the issue.
(How to do so would be a separate question, perhaps on SuperUser.)
Related
I have an Access 2013 database split across a network that is mainly used via Citrix. I keep getting the error message that the database is in an inconsistent state and I don't know why. I created a query to capture the user name and machine id as a auto-exec macro so I can go back and ask users what happened etc. But what I'd like to know is if it would be possible to know which user first encountered this error? Can I trap the error somehow and know which user "caused" it? I have a feeling that this error happens prior to the auto_exec macro firing but I live in hope.
What I am hoping to be able to do is get with the Citrix team and see if they have a corresponding error or something in their logs.
.. sadly they are all sharing the same front end. It's only being used
for read-only lookup purposes. I wanted each user to have their own
copy but IT disagreed with me.
The only way it could work reliably, is if the accdb file itself is marked as Read-Only, and that would probably leave your application useless.
I've been through this with a client running a huge Citrix setup (40000+ employees) for an application with a priority. IT had for a reason a strict view on security, but though quite cooperative, they were of little help.
However, I got it solved by a VB script. It worked in the first attempt and so well, that I wrote up a description here:
Deploy and update a Microsoft Access application in a Citrix environment
The great thing is, that you probably won't need IT to do anything for you.
I have a multi-user split access DB with a front end and back end on a network drive. I often need to make structural changes to the back end of the database but the file is always locked due to the frequent use of the file by many users and the fact that nobody seems to be able to close the file when they are finished with it.
When I need to modify the file I have to contact IT to kick everyone out of the file from the server which is a real pain.
I've tried things like coding an auto close timeout on the FE and a few other vba methods but over time there will always be something that causes the FE to hang or something before running the necessary code leaving the BE locked.
Is there any way to get access to the file without needing access to the Server settings?
Unfortunately, no.
Unless you implement a listener on the FE that looks at a flag on the BE and closes the FE when the BE flag is set (it sounds as if you've tried something like that), there is no way to do what you want. You can't even open the BE exclusively unless there are no other users. This is just one of the reasons that Access is not really a preferred multi-user DB solution.
Okay, so I have a couple of hundred reports in my MS Access database (yes, it's a big project, and yes, we should switch to SQL Server). I was working on one of the reports yesterday and was suddenly disconnected from the network. I have been having a lot of network outages at work, and I think it has something to do with the sudden disappearance of all the reports. I have never had admin privileges to set up Backup and Restore on my machine, and have had to back up the database manually myself.
My most recent version is from a week ago, but I have done A LOT of work since then. My question is whether or not a sudden disconnection from the network (and, subsequently, the database I was working in), could have caused the deletion, and whether or not it is possible to restore the database without having Backup and Restore set up on my computer.
Please help.
Edit: My databases are in a front-end/back-end format. It was the front-end database (with the reports, queries, and forms) that crashed, but the only items that were deleted were the reports.
It your database was corrupted once, it's hard to tell if it's possible to restore your missing reports from it.
The only 100% safe way to restore your changes would be to have a recent backup from before the corruption happened.
But it's definitely possible that a network outage, while users accessed the database and you made changes in the reports at the same time, lead to corrupting the file.
I know that it doesn't help you right now, but here is some advice for the future:
You should think about splitting your Access database in a front-end (which contains forms, reports and code) and a back-end (which only contains tables).
The back-end will be located on a central machine, and each user will have his own copy of the front-end.
Of course splitting the database and ensuring that the front-ends are automatically updated on the user's machines will require some initial work, but you will gain two benefits from it:
When you work on the front-end, you are working on your local machine, so you are less affected by network outages.
The back-end is more unlikely to be corrupted. As you unfortunately experienced yourself, changing reports, forms and code in an Access database that's in production use at the same time can lead to issues.
Plus, even if you're not able to set up Backup and Restore on your computer, you should backup your work more often. I do this several times a day by just copying the Access database manually (you will do this automatically without thinking once you're used to it).
EDIT:
Okay, it wasn't really clear from the question that your database is split into front-end and back-end.
The network outage stuff made me think that you were editing the "one and only central database".
I don't remember that I ever experienced something like that by myself, so I can just guess what you could do now.
One thing that comes to my mind is that you could try to export your reports (given that you know their names) to text files with the undocumented SaveAsText and LoadFromText commands:
'save your report in a text file on your disk
Application.SaveAsText acReport, "YourReport", "c:\YourReport.txt"
'load your report from the text file in another Access database
Application.LoadFromText acReport, "YourReport", "c:\YourReport.txt"
But this is just an idea, so I don't know if this will work in your case.
Maybe the reports are still there (and just not shown for some reason), then it might work.
I'm sorry to say this again, but:
Honestly, I don't have a lot of experience in repairing corrupted databases (not Access, and neither SQL Server, for which I'm responsible at work!) because I try very hard to never come in a situation like yours by frequently taking backups. LOTS of them (I've been called "paranoid" by co-workers because of that).
EDIT 2:
I just read in your comment to phoog's answer that the corrupted database was on the network (i.e. you edited it while it was on the network).
Advice for the future:
Don't ever do this, for the reasons that phoog already mentioned in his answer. If the database is already split into front-end and back-end, make a copy of the front-end and edit it on your local machine to prevent such stuff from happening again.
Plus, if the front-end with the reports is used by several users, don't let them all work on the same file on the network (for the same reason).
It's incredibly easy to give each user his own copy, including auto-updating when there's a new version of the front-end.
You can read here how I'm doing this at work:
How to automatically update MS-Access 2007 application
Your question leaves open several important points:
How is your application set up?
Is the MDB containing the reports on your network?
Are the tables in the same file or another one?
If the tables are in another file, where is it located?
Access is notoriously susceptible to data loss and file corruption when network connectivity is spotty. See http://support.microsoft.com/kb/303528 (the section "Additional best practices for network environments") for more information.
The information in this article ("How to troubleshoot and to repair a damaged Access 2002 or later database" http://support.microsoft.com/kb/283849) may help
Any files that you have on the network should have been backed up by your network administrators, so ask them for the most recent backup before you lost your reports. With luck, this will be more recent than your own most recent backup.
An old site on shared hosting has developed an error when executing a simple SQL statement
Microsoft JET Database Engine error '80004005'
System resource exceeded.
/411971/users1.asp, line 68
Line 68 is Set objCon = objCommand.Execute
The Access database isn't large (less than 2Mb), this is a single table query and the table only contains around 500 records. Field count is only about 20 too with no memo fields. Nothing has changed in the script. A compact/repair on the database has no effect, as does creating a new database and copying the table in question too it.
Looking round in the web this would appear to be most likely a web server issue rather than the code (and the behaviour would indicate this too) but I'm not finding anything conclusive - and knowing how shared hosting support works I'd like to have a definitive case before I go to them. Has anyone else seen this error/behaviour before and what was the problem/solution.
OUTCOME: I made sure I'd tried all the obvious approaches then emailed the ISP support who confirmed it was a server issue and restarted services, which fixed the problem
It may simply be a connection limit. On shared hosting with other sites using the same backend the limits are easily hit. Whilst you can help by making sure you explicitly close any connections after your script has used them, in the end this would be a hosting issue your provider would need to look at.
This is probably not what you want to hear, but Access/Jet is an unsuitable database backend for a web application. I got hangs and inexplicable errors like this from it with just a couple of concurrent users. When MySQL and SQL Server Express are free there is no reason to use Access on the web.
If the issue happens again, just ask your hosting provider to recycle the application pool on IIS.
I'm using Access 2003 on a duo-core machine with 4GB of RAM, running Windows XP (Service Pack 3) [5.1.2600]
Periodically, I get an error msg "There isn't enough memory to perform this operation. Close unneeded programs and try the operation again."
A check of Task Manager indicates that there is plenty of free memory. Closing other open programs makes no difference.
This happens sporadically, and under different circumstances: sometimes whilst saving Form design or VBA code changes, sometimes when several Forms are open and in use.
If attempting to save design changes, and this error occurs, the Access objects are corrupted and can't be recovered.
Any suggestions on what might be causing this would be very welcome.
MTIA
The VBA project in your front end is likely corrupted. You need to rebuild it from scratch and then use proper Access coding practices:
in VBE options, turn off COMPILE ON DEMAND (see Michael Kaplan's article on DECOMPILE for details of why).
in VBE options, turn on REQUIRE VARIABLE DECLARATION.
in the VBE, customize your toolbar so that the COMPILE button is easily accessible (it's on the Debug menu). I also recommend adding the CALL STACK button (from the VIEW menu), as it's handy for debugging errors in break mode. The point here is to make debugging and compiling as easy as possible.
having set up your environment, go through all the modules in your newly recovered project and add OPTION EXPLICIT to the top of every module that lacks it. Then compile. You'll quickly find out where you have invalid code and you'll need to fix it.
from now on, when programming, compile frequently, after every two or three lines of code. I probably compile my project 100 or more times a day when coding.
periodically decompile your project and compact and recompile it. This will clean out any crud that accumulates during regular development.
These practices insure that the code in a non-corrupt project stays in as clean a condition as possible. It will do nothing to recover an already corrupted project.
In regard to how to rebuild the project, I think I'd go the drastic route of exporting all the objects with Application.SaveAsText and importing them into a new blank database with Application.LoadFromText. This is superior to simply importing from your existing corrupted front end because the import can import corrupt structures that won't survive a SaveAsText/LoadFromText cycle.
I program daily in Access, working with non-trivial apps that use lots of code, including plenty of standalone class modules. I have not lost an object to code corruption in over 5 years, and that was back in the day when I was still using A97.
Having tripped across this old post of mine, and seeing it's had a fair bit of interest, I thought maybe an update would be in order?
So 2 years down the track, doing a lot of 2007 app work as well as older 2003 (and even '97) apps, I'm finding that 2007 is less prone to really nasty crashes than 2003 - where Access object definitions (forms and reports esp.) would be easily corrupted.
I still follow the suggestions 1-6 (above) by David-W-Fenton religiously though, plus the use of Application.SaveAsText (see Tony Toews' suggestion and link above).
These days, whether it's 97, 2003 or 2007 I'm working on, if Access gives any hint of "being weird | crashing | throwing inexplicable errors" etc, I do the following:
Immediately close the Access app
Backup the mdb/accdb file
Re-open the app whilst holding down [Shift] so nothing runs
Export all objects as text using Application.SaveAsText (as another backup)
Close and re-open the app using the /decompile switch
Recompile the VBA code
Do a Compact/Repair.
This doesn't solve everything, but it does significantly reduce the number of corruptions of Access objects from what I'm able to observe.
Oh my.
I worked in a shop for many years that used Access as their platform of choice. The application eventually got so large that it began hitting an internal memory limitation of Access 2003. They began experiencing the exact same problem that you are having. As you have noticed, there is no external indication of memory problems when this happens.
The company talked at length with Microsoft about the problem, and I believe Microsoft eventually supplied them with a patch. So you might want to talk to Microsoft about this, if it sounds like a similar situation to what you are experiencing, as they may be able to supply you with the same patch.
Ultimately the long-term solution is to break the application into smaller pieces. Moving to Access 2007 didn't help; in fact, it made things worse because Access 2007 has more moving parts.
Quick solution; guaranteed to work:
Open VBA (Alt-F11)
In the immediate window enter the following:
Application.SaveAsText acForm, "corrupt form name here", CurrentProject.Path & "\zzTempRevive"
then
Application.LoadFromText acForm, "corrupt form name here", CurrentProject.Path & "\zzTempRevive"
That's it :) Hope this helps others!
This is also the default error message when Access has no idea what the problem actually is. Now if your MDB is particularly large, say more than 800 forms and reports with modules then, yes the MDB could be too large although that gave you a message when you went to create MDEs. ACC2000: "Microsoft Access Was Unable to Create an MDE Database" Error Message
I have had this happen occasionally myself. And my current MDBs aren't quite that large. Note that compact and repair doesn't detect errors in objects other than tables, indexes or relationships. So importing into another MDB is the only way to correct these errors.
Are you working on this MDB over the network? That's about the only thing I can think of that might cause this problem.
As I know that it's either forms or reports that most likely get corrupted, I created a new mdb, and only imported tables (attached), queries, scripts (one only), modules and menus. Then I used LoadFromText to import Forms and Reports via a function, and then did the usual decompile/compile and compact/repair etc.
So far, touch wood, I haven't had another crash in some days, so I'll probably stick with this recovery method.
Many thanks to all for your suggestions.
I have encountered this problem many times and finally found a solution that worked. I don't know what causes the problem, but I do know how to solve it.
Usually the error occurs when you open a form. What you need to do is completely re-create that form. The easiest way to do so is to first export the form to a text file with the undocumented function Application.SaveAsText. Then you delete the form from your database and re-load it with Application.LoadFromText.