SQL state 37000? More database problems.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
raymondkwoods
Forum Newbie
Posts: 5
Joined: Sun Aug 21, 2005 2:14 am
Location: Modesto, Ca.

SQL state 37000? More database problems.

Post 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?
ody
Forum Contributor
Posts: 147
Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK

Post 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?
Post Reply