CryptoAPI Function Generates an Error When You Try to Connect to an Instance of Microsoft SQL Server.

April 16, 2004 | KB: 1000488
Server (MSDE) 6, Server (MSSQL) 6

Summary

When the LaserFiche server connects to an instance of Microsoft SQL Server, you may receive the following error message:

    MSSQL Server Logon. Connection failed. SQL State 42000 SQL Server error 552

    [Microsoft][ODBC SQL Server Driver][SQL Server]CryptoAPI function 'CryptAcquireContext' failed.
    Error 0x8009001d: Provider DLL failed to initialize correctly.

Cause

This error can occur because of a problem with the OLE32.dll file. If the default load address is occupied, the OLE32.dll file dynamically changes, which returns this error message.

This error can occur if the server machine meets all of the following conditions:

  • Operating system: Windows NT 4.0 (Workstation, Server, or Enterprise Server).
  • Memory: 512 megabytes (MB) or more of RAM.
  • Database engine: MSDE 2000 or Microsoft SQL Server 2000 Personal Edition.
  • Method of SQL Server log on: SQL Server Authentication.

Resolution

This is a documented Microsoft issue. Configure Microsoft SQL Server or MSDE to load the OLE32.dll file during the server startup process. This workaround is taken from the Microsoft article listed in the More Information section.

  1. Click Start and then click Run.
  2. Open a command prompt window by typing the following in the Run dialog and then clicking OK.

    cmd

  3. Use the osql utility to connect to your instance of SQL Server or MSDE by typing the following:

    osql -E -S Computer_Name\Laserfiche

    If successful, go to step 12.

    Note: If you are using the full version of SQL Server, remove Laserfiche from the previous line.

  4. Modify the Windows Boot.ini file to limit the amount of RAM Windows will recognize.
  5. From a text editor, open the Boot.ini file found in C:\.
  6. Use the following code to modify the Boot.ini file. Use the /maxmem option to limit the physical memory that Windows NT 4.0 registers to 96 MB.

    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows NT" /maxmem=96

  7. Restart the computer.
  8. In Task Manager, verity that the physical memory that Windows NT registers is 96 MB. If not, make sure that you performed step 2 correctly.
  9. If the instance of SQL Server or Desktop engine has not started, use the Administrative Services Tool to start the service:
    1. Click Start and click Control Panel.
    2. Click Administrative Tools.
    3. Click Services.
    4. Scroll down and click either the MSSQLSERVER service if you are running the full version of Microsoft SQL Server or the MSSQL$LASERFICHE service if you are running MSDE.
    5. From the Action menu, select All Tasks and click Start.
  10. Try to connect to SQL Server by using the osql utility. Use the sysadmin login and the appropriate password:

    osql -U username -P password -S Computer_Name\Laserfiche

    Note: If you are using the full version of SQL Server, remove Laserfiche from the previous line.

  11. If you cannot connect, note the error message that you receive, and then open a support case with Technical Support.
  12. If you can connect to the instance of SQL Server by using the osql utility, run the following query to set up the startup stored procedure:

    SP_PROCOPTION 'sp_MSgetversion', 'STARTUP', 'TRUE'
    GO

  13. Restart the instance of SQL Server or Desktop Engine.
  14. View the most recent Errorlog file and verify that the sp_MSgetversion is being called during the SQL Server startup process. The line in the log should look similar to the following:

    2002-04-30 12:09:28.00 spid 3        Launched startup procedure 'sp_MSgetversion'

    The Errorlog file can be found in the LOG folder of your SQL Server Installation folder. The default for MSDE is C:\Program Files\Microsoft SQL Server\MSSQL$LASERFICHE\LOG. The default for SQL Server is C:\Program Files\Microsoft SQL Server\MSSQL\LOG. If you do not see this in the Errorlog file, repeat step 10 through step 13.
  15. You should now be able to open the LaserFiche database.

Important: If you performed step 6 to reduce the memory that the operating system registers, modify the Boot.ini file, but remove the /maxmem parameter that you originally added in step 6. Restart the computer, and then verify that Windows NT 4.0 can now see all the physical memory that is on the computer.

More Information

For additional information on error 0x8009001d, visit the Microsoft Knowledge Base and search for article 321459 or click the article number below:

321459 PRB: The CryptoAPI Function Generates an Error When You Try to Connect to an Instance of SQL Server 2000