How To Resolve SQL Error 126

What is "error 126? or ?loading library sqlcax.dll? error?

The ?error 126? is shown when some of the dll files related to the SQL (Structured Query Language) database are missing. This happens when an application is trying to connect to the database and either the path to the files or the file itself goes missing.

Applications affected are:

  • Microsoft SQL Server 2000 Desktop Engine (Windows)
  • Microsoft SQL Server 7.0 Standard Edition

Error that appears on the screen

?Loading extended custom action library sqlcax.dll
Starting custom action SkuIt
An internal error occurred during install (failed to load package id).
Contact Microsoft Technical Support.
Action ended 15:35:19: InstallFinalize. Return value 3.?

or

?Error 126: The specified module cannot be found?

or

?Specified driver could not be loaded due to system error 126 (SQL Server)?

What causes Error 126 and how to solve this problem

SQL is a database management software which is used to store data using relational database management system principles, and is used as a data bank. Data is stored in a sequential way and can be accessed using different tools provided by the operating system.
The problem starts when the tools trying to fetch the data find the core database files missing. This can either be because:

  1. The path to the database file is missing.
  2. The core files of the database are corrupt.

Every system running the database needs to create a client side library so that a client side system can connect to it. While creating the directory, you have to specify the path pointing to the database files.
If this path is not specified, you get an error message.

To find out if the path is specified correctly you can follow the steps below:

  1. Right-click on My Computer and then select Properties.
  2. Open the Advanced tab.
  3. Click the Environmental Variables button.
  4. Check the path under the Administrator and System Variables.
  5. If the path for SQL is not specified, click Add and specify it. Usually they are pointed to c:\winnt and you can change it to c:\windows
  6. Click OK and restart the system.

If this doesn?t solve the problem, ?you can try the next step.

Extracting Core Files:

The core files which can be corrupt or missing can be Srvsvc.dll, sqlsrv32.dll, Semnt.dll, Sqlsvc.dll, or Sqlresld.dll.

You can extract the file using the Win XP cd. The steps are given below:

  1. Insert the Cd into the Cd-Rom drive.
  2. Click on Start and then Run.
  3. Type cmd and Click OK.
  4. At the prompt type the following commands and after every line press Enter to run them.

expand? <CD_drive>:\i386\srvsvc.dl_ C:\Windows\system32\srvsvc.dll
expand? <CD_drive>:\i386\ sqlsrv32.dl_ C:\Windows\system32\ sqlsrv32.dll
expand? <CD_drive>:\i386\ Semnt.dl_ C:\Windows\system32\ Semnt.dll
expand? <CD_drive>:\i386\ Sqlsvc.dl_ C:\Windows\system32\ Sqlsvc.dll
expand? <CD_drive>:\i386\ Sqlresld.dl_ C:\Windows\system32\ Sqlresld.dll

Here, the CD drive represents your CD-Rom drive D: or E: etc. When you run these commands, the dll files are extracted into the system32 folder. This should completely take care of the error 126. If this still does not solve the problem, then you can reinstall the SQL server package by downloading it from the Microsoft website.

This should take care of the problem completely. You can get more information on database errors from the Microsoft Support website and the SQL Team Forum.