Reputation: 3428
I'm trying to connect to a sqlite3 database using ADOdb. Using:
Fatal error: Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file'
sqlite:
Could not connect to database
$driver = "pdo_sqlite";
$db = NewADOConnection("$driver://".urlencode(dirname(__FILE__)."/test.db3"));
if (!$db) {
die("Could not connect to database");
}
edit
I also asked the question on adodb's forums: http://phplens.com/lens/lensforum/msgs.php?id=19236
Upvotes: 0
Views: 2314
Reputation: 3428
I edited drivers/adodb-sqlite3.inc.php
. Function _connect()
if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename;
$this->_connectionID = new SQLite3($argHostname); // hack
if ($this->_connectionID === false) return false;
$this->_createFunctions();
return true;
seems to work with my little test (active record: new item, save, reload it, delete).
Upvotes: 0