Welcome Guest, Not a member yet? Register   Sign In
ODBC
#1

[eluser]North2Alaska[/eluser]
I'm setting up a new app that will connect to a MS Sql Server database. When I initialize the database.php file and run the welcome controller, I get the following error:

Code:
Fatal error: Call to undefined method CI_DB::CI_DB() in E:\wamp\www\ci\system\database\drivers\odbc\odbc_driver.php on line 53

I thought maybe ODBC wasn't setup correctly, but I can query the database with direct commands:

Code:
$conn=odbc_connect('Driver={SQL Server Native Client 10.0};Server=zrtpd0j6\Corp1;Database=Pricing;','myuser','thePass');
if (!$conn)
  {exit("Connection Failed: " . $conn);}
$sql="SELECT 'HELLO WORLD' as msg";
$rs=odbc_exec($conn,$sql);
if (!$rs)
  {exit("Error in SQL");}
echo "<table><tr><th>Message</th>";
while (odbc_fetch_row($rs))
  {
  $msg=odbc_result($rs,"msg");
  echo "<tr><td>$msg</td></tr>";
  }
odbc_close($conn);
echo "</table>";

My database.php looks like this:
Code:
$db['default']['hostname'] = "Driver={SQL Server Native Client 10.0};Server=zrtpd0j6\Corp1;";
$db['default']['username'] = "myUser";
$db['default']['password'] = "thePass";
$db['default']['database'] = "Pricing";
$db['default']['dbdriver'] = "odbc";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "";
$db['default']['dbcollat'] = "";

I am running on Windows XP with WAMP running locally. I am using the latest SVN version of CI, even though it says 1.7.1.

I've done a search of the forums but find nothing recent about this error. Any suggestions?


Messages In This Thread
ODBC - by El Forum - 09-04-2009, 09:49 AM
ODBC - by El Forum - 10-09-2009, 06:32 AM
ODBC - by El Forum - 01-05-2010, 11:48 PM
ODBC - by El Forum - 01-06-2010, 05:28 AM
ODBC - by El Forum - 05-14-2010, 11:41 AM
ODBC - by El Forum - 06-26-2010, 05:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB