How to fix not being able to load DAO DLL in Access 2003 on Windows 7?

I have an application that uses MS Access 2003 interface to connect to MS SQL and Sybase database. This application uses VBA (Visual Basic 6) and this cannot be changed. We are in the middle of the conversion from Windows XP (where the application works fine) to Windows 7.

On Windows 7, attempts to connect to Sybase databsae fail. The application uses pass through the request and when it fails I get the following message:

An unexpected error occurred in Call_SP.
Error number: 48
Error description: Error in loading DLL
Error source: Secure open security

      

The specific line of code where this error occurs:

For Each qryDef In dbLocal.QueryDefs

      

The elements in this line of code are defined as follows:

Dim dbLocal As Database
Dim qryDef As QueryDef

Set dbLocal = CurrentDb()

      

The initial launch of the application was missing a reference to the Microsoft DAO 3.6 Object Library. I copied the dao360.dll file to C: \ Program Files (x86) \ Common Files \ Microsoft Shared \ DAO, registered it with regsvr32.exe and set a link (Tools -> Links) to that file.

At this point, I suspect the issue might have something to do with user rights on this computer, but I'm stuck on where to start. Users have read and execute rights on the dao360.dll file.

We have many legacy applications written in Access, so our systems use Access 2003, but Word, Excel, and Outlook 2010. We are moving to Windows 7 64-bit.

+3


source to share


4 answers


If I was at your best, I would try the following:



  • Uninstall and reinstall Access

    And I would run a registry cleaner like CCleaner to remove the obsolete library link from the registry before reinstalling Access and applying all updates.
    The fact that dao360.dll was missing or was incorrectly registered indicates that there is at least one installation problem on this machine.
    Also, uninstall and reinstall your ODBC drivers for other databases.

  • Try to use the same computer with another user

    Create a new user on the machine, then login with that user and check if there is still a problem.

  • Try using a different car

    Use the same database, make sure the DAO links are selected and re-request the code.
    If it still doesn't work, then there is another problem and it is not DAO related.

  • You mention using Sybase and SQL Server.

    Are the ODBC drivers working correctly? Could there be some corruption in the car?
    What if you are creating a new database and trying to execute one end-to-end request using the same connection string?

  • 32 and 64 bit mixup

    Are you sure all dependent programs and database drivers are installed to 32-bit?
    If you try to access an ODBC data source that uses a 64-bit driver from a 32-bit application, it won't work.
    In Win7 x64, the ODBC console accessible from the admin tools in the control panel is not 32bit!
    You need to create your DSN using C:\Windows\SysWOW64\odbcad32.exe

    .

+2


source


The solution I came across was to use weak typing and reference all DAOs via CurrentDb. The only references I have in my project are VBA and Microsoft Access Object Library which are required anyway. It's a bit radical, but it gives you something to deploy on any platform.

Each newly created Access database project contains a reference to the DAO library. But the DAO library references are no longer updated when the databases are deployed on different machines. This functionality was broken in Access 2007 when the DAO library was renamed.



In your example, this would be:

Dim qryDef As Object
For Each qryDef In CurrentDb.QueryDefs

      

+1


source


There is no need to try to re-register the dao library here, and doing this is a silly wild goose hunt and is a waste of company resources. Installing Access 2003 on this machine should work very well and installing 2003 on that machine will ALSO install the DAO libraries correctly (trying to copy and re-register the DAO library can make your machine a complete mess here - don't, and it is not required).

There are either some broken links, or perhaps the ADO library was posted higher in the links compared to the DAO library. Actually check the links in the VBA editor. If ADO is not used, remove the link.

Also, if you are using Outlook from this application, remove the link to Outlook in this application. You really need to use the latest binding for your Outlook automation code.

I have been running Access 2003 on Windows 7 x64 since winning 7 beta and I had zero level issues here. It has nothing to do with x64 or win7, but only with the behavior of a typical broken link.

+1


source


The problem occurs when installing x86 and x64 versions of OS / Access.

  • You need to create a directory (I'm sure it's not exsit and you need admin rights to do this): C: \ Program Files \ Common Files \ microsoft shared \ DAO
  • Copy dao360.dll from C: \ Program Files (x86) \ Common Files \ microsoft shared \ DAO to the directory created in step (1)
  • Now add the link to your VBA application.
0


source







All Articles