Home » Database » DB » Bug #9512
Database connection failure with length over 30 char
Details
| Submitted | 2006-11-30 19:49 UTC |
|---|---|
| From | krenzer001 at gannon dot edu |
| Assigned | danielc |
| Status | Bogus |
| Package | DB |
| PHP Version | 5.1.6 |
| OS | Microsoft Windows Server 2003 |
| Roadmaps | (Not assigned) |
Comments
[2006-11-30 19:49 UTC] krenzer001 at gannon dot edu
Description:
------------
I'm using the Pear DB package to query a Mssql database. If the Database name is over 30 characters I get an error message saying that no database was selected. I can connect to any databases that has a name of 30 characters or less and I can run queries to create databases with names greater than 30 characters but I cannot connect to the database once it has been created if the name is greater than 30 characters. I've put an example of the connection string below, dBTYPE, USER, PASSWORD, and HOST are global variables, $dbName is the database name.
Test script:
---------------
$dsn = dBTYPE . "://" . USER . ":" .PASSWORD . "@" . HOST. "/". $dbName;
DB::connect($dsn);
Expected result:
----------------
I expect to get a connection to the database in the $dsn
Actual result:
--------------
DB Error: no database selected
[2006-11-30 20:04 UTC] krenzer001 at gannon dot edu
This is the code I used to catch and throw the error
if(DB::isError($this->conn)) {
//We're not connected. Throw an exception
throw new Exception($this->conn->getMessage(), $this->conn->getCode());
}