473,499 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Logging break in connection to Back-End

10 New Member
An Access system of 10 years vintage is starting to give 'corrupt database' errors. I've written a mini-app to allow the User to run Compact and Repair operations on both the FE and BE databases which allows him re-start working.

I've attributed the problem to the IT department 'doing some work on the network' but the problem (intermittent, say 1-2 time a week) seems to be ongoing.

I'm thinking of writing a mini-app to be run outside the main application that will do something like looping a DLookUp on a small table in the main app just to check it is still there and accurately record when (and if) it disappears. And then potentially when it re-appears.

Is there a better way? I feel I might be re-inventing the wheel!
Oct 28 '20 #1
15 5392
SwissProgrammer
220 New Member
"starting to give 'corrupt database' errors." Attention !

"Is there a better way?" Maybe yes.

(1) I would seriously consider a full backup of the data drive(s) immediately first!
Now! Call in the team. Do an all-nighter or round-the-clock if you can easily afford it, and back up (to clean new drives) at least all of your data drives. Immediately!
(2) After that, defragment the original drives.
Defragmentation has had negative effects if the drive is damaged or if it is so full that the defragmentation process itself is fragmented beyond the useful scope of your drive. So, back up the drives first as they are now. Look at "EASEUS ToDo Backup" and other programs like that which have sector-by-sector backup capability. Do two types of backup: Simple backup of entire drive; and separately do a sector by sector backup.

It sounds like your drives have reached their read/write limits.
That could mean that they have less than enough room for new data.

That could mean that they have written to and read from sectors so many times that the sectors are wearing out and not responding correctly.
(2a) If defragmentation will not work due to damage to the drives, then do a disk check and disk repair. Then do the defragmentation.

(3) Try the original drives. If they work well after defragmentation then use them and apply the 2050 rule. If they do not, then replace them (and load onto the replacement drives the back up) and apply the 2050 rule.

(4) The 2050 Rule:

When you replace your drives, either use larger drives or split the data bases across multiple more drives. Your goal should be to split your current data onto enough drives that the data takes up less than 20% of each drive. Less than means less than, not more than or close to; but less than.

Then, when you see that any of your drives are using more than 50% of the space, split that data across two new drives.

If you get arguments against this then go study how drives hold information and how the sector spaces are allocated, then you will probably see the logic of 20/50

Thank you for asking.

.
Oct 29 '20 #2
twinnyfo
3,653 Recognized Expert Moderator Specialist
Tango1,

Welcome to Bytes!

This "may" be as serious a problem as SwissProgrammer describes. But let's start smaller first. I've been recently experiencing some similar problems with our DBs, and much of it has to do with networks not playing nice with Access (or the other way around, actually). This is particularly exacerbated by VPN access, which seems to corrupt data in Access more frequently, and with telework on the rise in our office, we are seeing more corrupt data files.

I would begin by backing up your FEs and BEs. Kick everyone out of your DBs and keep them out for a while. With your BEs, create brand new, empty DBs and import all your data tables from scratch. Make sure you then also compact and repair those new data files.

Do the same with your FEs. You will have to make sure you also include any additional references in your VB editor. Make sure your FEs fully compile (which if you are making an executable FE--and you should, it won't be created unless it fully compiles).

In 99 44/100% of cases, this will solve your problem. A corrupt disk or network will probably cause more significant problems than corrupt data files. A disk unable to write to a particular sector, for example, will not be able to compact and repair a DB at all, since the data is completely gone.

Hope this hepps!
Oct 29 '20 #3
Tango1
10 New Member
twinnyfo and SwissProgrammer thank you both for your detailed responses. You were both err-ing on the side of bad hardware or corrupted code and I would pursue these if I could. However, the client is an 'international' and difficult enough to get through the front door in normal circumstances.....

The BE is on a server in their datacentre. Two things I could possibly do is have them convert it from an MDB to a ACCDDB hoping that is tantamount to exporting to a clean database. Secondly, if they would expose their server/share name I could link via a UNC rather than have them create mapped drives for each user. These are on my 'To Do' list but don't think they are essential tasks.

The BE is comprised of two MDB's. The Main Data and an Audit Trail (recording who changed what, when and by how much). 15 years ago my reasoning that the Audit Trail would grow over time and could be truncated without compromising the live data. However, main data is only 90MB and Audit Trail 50MB, so size has not been an issue!

The FE has not been modified for some time so I don't expect any corruption there but still re-installed from the distribution version. Compact and Repair of the FE does not restore the system, hence I had to write something so the User could fix the BE's.

There are only 4 users on the system, two who just read and print.

All previous experiences of failure in Access have been the results of network issues; BNC connectors being trodden on under the desk; electrical interference from an overhead crane when a motor flashed over; problems storing the BE on a NAS rather than a proper server and more recently people trying to connect via WiFi. Hence my recent interest in Network monitoring.

I can imaging doing a 'DIR' call to see if a file is still available to check the network is 'up', or a DLookup to see if the database is in an inconsistent state. I imagine I am not alone with this problem and thought there may be a clever system call or piece of software that would do this simple task other than professional suites that sit on the server.

Thanks for taking time to respond. I know how much it eats into your day answering these sorts of questions.
Oct 29 '20 #4
isladogs
457 Recognized Expert Moderator Contributor
In my experience, when errors occur that indicate corruption, running a compact & repair rarely helps.

I would suggest the following sequence to deal with any corrupted code:
1. Make a backup (just in case)
2. Decompile the FE - there is a very clear explanation of this process on the FMS website. Decompiling only takes a couple of seconds
3. Then recompile by running Debug...Compile from the VBE
4. Compact
Oct 29 '20 #5
Tango1
10 New Member
I agree with your first statement isladogs, a decompile is usually required to fix most errors. However, in this instance a C&R on the BE fixes the problem (there is no 'code' in the BE so nothing to decompile) but does nothing for the FE.

I did request the User to re-install the FE from the distribution copy, so should be clean and not require a decompile. I'll check today that he did this and also the exact wording of the error.
I fear he is using a Runtime version of Access.
Thank you
Oct 30 '20 #6
jimatqsi
1,271 Recognized Expert Top Contributor
Tango1, could you tell more about the problem, please. Under what circumstances does this problem occur? Is it at startup, during some particular transaction type or process, launching a form, etc .... Are all users seeing it randomly, simultaneously? Are you sure that all users are running the front end locally and not on a network drive?

The most common expression of this problem that I have seen is that users don't understand the difference between running a copy of the front end on their own computer as opposed to using a shortcut to the front end on the network somewhere - and multiple people end up running in the same copy of the front-end. In that case, this kind of result is inevitable.

Jim
Oct 30 '20 #7
Tango1
10 New Member
Hi Jim. Thanks for your reply.
The main user is in a laboratory and has the system open all day. He finds the system has broken after entering a item-number and gets the message "database is not available" when trying to retrieve details of that item. (I'm trying to illicit the exact wording.)

Failure is not isolated to just one form but seems can occur at any time an enquiry is made i.e. listings by equipment type or department etc. Hence my belief it is a network issue (and the fact that the software has not changed but it sounds like the network has)
I thought perhaps there was uncommitted data pending in an open form which may have caused a problem if there was a 'hiccup' on the network but am assured that the problem can occur between searches for multiple items. i.e. one works but the next fails.

Although it is the 'main' user who reports a problem I am also enquiring what other user might be doing. Everyone seems to be locked out once an error occurs. It's not inconceivable that someone in 'Store' is goofing a transaction that manages to break the system. I will have this investigated.
Oct 30 '20 #8
jimatqsi
1,271 Recognized Expert Top Contributor
What does this mean, what are they seeing? "Everyone seems to be locked out once an error occurs"

Since it affects everyone when it happens, it sounds like the problem is not on the client but on the server end, assuming everyone is running their own, private copy of the front end.
Oct 30 '20 #9
Tango1
10 New Member
Yes, the BE seems to go into an unresponsive state which can be fixed by a Comp & Repair.

I'm going to pursue the suggestion to export the BE to a clean database in case there is something like an index that is not being properly rebuilt by a C&R.

I'm also trying to get a better description of the error rather than "it's something like the database is not available".

I'm also going to try and emulate the problem by deliberately crashing a mapped drive to see what errors arise. Partly because the consensus of opinion here is it will be an Access problem and not a network problem. Partly to test my network logging mini-app.

I'll post again when I have some results.
Oct 30 '20 #10
SwissProgrammer
220 New Member
Tango1,

If you can mirror the entire user's system and test it at your place with your techs error checking one step at a time, you might find (some of) the problem(s). Then when you have found at least some of exactly what causes exactly which problem, post it here.

Your biggest problem at this time might be asking non-tech to tell you what technically is happening. Try to not put any further technical the burden on them as that might strain your contract relation and future reputation.

If you have to, get permission to go to the customer, with their (totally the customer) paying the travel and the Per Diem for the entire process. Get their written permission to set up a mirror site at their location (for security) and have your techs error test it and analyze it there. Include in the price the customer paying for a fully usable mirror (servers, hardware, cabling, etc.) at their site. Contract to leave it there when you leave so that if something else happens later it is there for you to use. The customer should pay for all of this. You should not pay for any of this. Then when you have found at least some of exactly what causes exactly which problem, post it here. Tell your customer to expect the length of stay to be 4 times what you expect it to be; because estimates by management are commonly less than 1/2 of what the techs advise management might be needed, and because it is also common for it to take at least twice as long as the techs think it will to fix a problem.

That is how I used to do this. Our competitors sent their problem customers to us. Our customers commonly were satisfied. I suggest that you get full control of this fast and decisively before you chance losing your contract and your reputation.

Take as many of your techs as you think that you "might" need.

Thank you for asking.
Oct 30 '20 #11
isladogs
457 Recognized Expert Moderator Contributor
Hi TANGO1
I suggested decompiling as it seemed that corruption was in the FE.
Obviously there is no point decompiling a BE as it will have no code
Oct 30 '20 #12
Tango1
10 New Member
Hi Guys
Thanks for your help so far but I fear we have an unsolvable issue here, probably caused by Microsoft Updates. Will probably need to rename this thread!

My user finally sent a screen shot of the error message and it was "Unrecognised Database format" . An internet search shows many other instances of this problem and Microsoft have suggested a registry hack on the server, to DisableLeasing.
https://support.microsoft.com/en-us/...rs=en-us&ad=us

I've obviously contacted the IT department to see if they can investigate this, because some other feedback suggests the network is slowed down as a result .....

Looking back, it was in November last year that MS put out a security update that effectively disabled the 'Update' syntax in an SQL command (kb 4484119) That took them 2 months to fix. So it's not unknown that changes outside of Access can impact on Access.

However, I fear that the current error can have multiple causes as some issues (on the internet) go back to 2018 (not just recent changes).

In the above link MS seem to think the issue is related to using DAO to open a database using VB code. I do this a lot because I started building systems in Access 97. I'm going to review my code and see what is involved in translating to ADO, as Plan B if all else fails.

Thanks again for your help everyone.
Nov 11 '20 #13
twinnyfo
3,653 Recognized Expert Moderator Specialist
Tango,

The "Unrecognized Database format" error occurs when the back end data has been corrupted. This can typically be cured by grabbing the back end data files, opening them natively, and then compacting and repairing them. This is a (somewhat) common occurrence with Access DB Files. Sometimes there is more to the story, which would require a rebuild of the data files and importing all the data. That is a more serious step, but hopefully this can solve your immediate problem.

Hope this hepps!
Nov 16 '20 #14
SwissProgrammer
220 New Member
twinnyfo,

That sounds labor intensive.

Can your suggestion of "This can typically be cured by grabbing the back end data files, opening them natively, and then compacting and repairing them." be done with a Command Line Interface batch file? Or maybe be done with some type of a script file? Or maybe by subclassing Access and run a custom executable on it?

If so, then maybe periodically the process could be run on a schedule.
Nov 17 '20 #15
twinnyfo
3,653 Recognized Expert Moderator Specialist
SP,

Programatically, yes:

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Public Function _
  5.     CompactDB( _
  6.         strSrc As String, _
  7.         strDest As String) _
  8.     As Boolean
  9. On Error GoTo EH
  10.  
  11.     CompactDB = Application.CompactRepair(SourceFile:=strSrc, _
  12.                                           DestinationFile:=strDest, _
  13.                                           LogFile:=False)
  14.  
  15.     Exit Function
  16. EH:
  17.     CompactDB = False
  18.     Exit Function
  19. End Function
Depending upon your network security protocols, this may require monitoring during execution. The theory here (to make sure you don't lose any data) is to follow these steps:
  1. Make a copy of your BE
  2. Compact your BE to a new file name
  3. Rename that file to overwrite the original BE

When I have corrupt data, I prefer to grab the BE and save it locally and perform manual compact and repair--simply because my local machine can do this much faster than trying to do it over a network (or even over PVN which is horrendously slow for us).

"In theory" this should help alleviate some of the problems. But, I can't guarantee anything. :-)

Hope this hepps!
Nov 17 '20 #16

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

Similar topics

13
1995
by: Fortepianissimo | last post by:
Here is the situation: I want my server started up upon connection. When the first connection comes in, the server is not running. The client realizes the fact, and then starts up the server and...
17
4064
by: Jon Ole Hedne | last post by:
I have worked on this problem some hours now (read many-many...), and I can't solve it: In vba-code I create a table with Connection.Execute, and add some data to it. This table is saved in the...
1
2451
by: Lauren Quantrell | last post by:
I'm wondering which is the best approach using an Access2K front end and a SQL Server 2K backend. I have a stored procedure running three INSERT INTO statements that inserts records into three...
1
3947
by: Chris | last post by:
I have a frontend that has some tables which are linked to a backend. Now I want to make the backend password protected and when I try to run it password protected I can't open it. In the first...
19
6049
by: =?Utf-8?B?Sko=?= | last post by:
I have a logging component that I will access in other assemblies. So it was brought up to me that I should pass an instance around to these components instead of just making the logging class...
10
1608
by: Christian Meesters | last post by:
Hi, having the following code: import logging logging.basicConfig(level=logging.ERROR, format='%(levelname)-8s %(message)s', filename='mc_rigid.log', filemode='w') # define a Handler which...
7
2740
by: =?Utf-8?B?Sm9obiBTdGFnZ3M=?= | last post by:
Hello, Please read this all before giving an answer :) I'm doing some troubleshooting on a web application that my company wrote. It's written in asp.net 1.1. The error that the Event viewer...
6
7558
by: Larry Bates | last post by:
Every time I look at the logging module (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6892
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.