2

Summary: DAO is trying to automatically open a nonexistent file - can this be prevented?


I maintain a VB6 program which uses the DAO36 library for accessing MDB / Jet databases. (Yes, pretty old stuff).

We noticed that during application startup it has been looking for file system.mdb which does not exist. This is not anything our own code was initiating.

Using Process Monitor I was able to determine that the program looks for this file around the time that the DAO library is loaded or initialized. After a bunch of DAO/Jet DLLs are loaded, one of them looks in the registry here:

HKLM\SOFTWARE\WOW6432Node\Microsoft\Jet\4.0\Engines\SystemDB

the value of which is indeed system.mdb. I can see the same in RegEdit:

enter image description here

Having located the desired filename from the registry it tries to open that file in the working folder of the program. i.e., I can see it try to find a file called:

C:\Program Files (x86)\<appname>\system.mdb

which of course does not actually exist.

I looked on Microsoft's website and also through older MSFT KB articles (1, 2), as well as here on SO. It seems that system.mdb is (or used to be) tied into how DHCP and WINS networking was configured in Windows NT. (e.g., refs 1, 2, 3 ... and many other KB articles indicate this).


This is the kind of 'red flag' that sometimes it is good to be proactive about before it leads to some (often rare and unreproducible) problem for an end user. So if there is any way to properly disable or configure this behavior I'd like to find out about it.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
  • Or another option, which I have done with several apps, is to upgrade your codebase to ADO. – Brian M Stafford Dec 16 '21 at 14:38
  • @BrianMStafford surely a valid general solution... tho in my case we're gradually transitioning to .NET over a period of years so prefer to keep the existing VB6 alive as-is, as much as possible, before it eventually just gets converted/replaced. – StayOnTarget Dec 16 '21 at 14:47

0 Answers0