Page 1 of 1

SQL state 37000? More database problems.

Posted: Thu Sep 01, 2005 9:41 pm
by raymondkwoods
This is what I'm getting now:

Code: Select all

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]CryptoAPI function 'CryptAcquireContext' failed. Error 0x8009001d: Provider DLL failed to initialize correctly. , SQL state 37000 in SQLConnect in
Too long to list all the code but here is the part I'm having trouble with:

dbConnectionString.php
------------------------------

Code: Select all

<?php
$dsn="Driver={SQL Server};Server=DEVSERV;Database=testDB;";
$username="test";
$password="test";
?>
test.php
----------

Code: Select all

<?php
require "dbConnectionString.php";

class test{
   /**
   * CONSTRUCTOR:
   */
   function test() {
      global $dsn, $username, $password;

      $sqlconnect=odbc_connect($dsn,$username,$password);
      $sqlquery="SELECT test_ID, name FROM testTable;";
      $process=odbc_exec($sqlconnect, $sqlquery);

      while(odbc_fetch_row($process))
      {
         $Name = odbc_result($process,"name");
         $ID = odbc_result($process,"test_ID");

         // More code goes here ...

      } // End while

      odbc_close($sqlconnect);
   }

   // More code goes here
}
?>
I had this working the night before and tonight I get this error. Have no idea why. Does anyone have any suggestions?

Posted: Mon Sep 05, 2005 2:11 pm
by ody
looking at the error it seems *maybe* something has has changed on the system your running this from..
Error 0x8009001d: Provider DLL failed to initialize correctly.
Have you updated your system? i.e. applied a service pack?