2012-07-18 3 views
0

ADOdb를 사용하여 sqlite3 데이터베이스에 연결하려고합니다. 사용 :php/adodb와 함께 sqlite 사용

  • PDO_SQLITE을 :

    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"); 
} 

편집

나는 또한 질문을했다 :

  • sqlite3를 작동 adodb의 포럼에 : http://phplens.com/lens/lensforum/msgs.php?id=19236

  • +0

    FYI : 정말로 4 개의 공백을 사용하거나'스스로 미친 html을하는 대신 코드를 강조 표시해야합니다. – j0k

    +0

    tryed하지만 실패했습니다 : ( – Sirber

    +0

    하지만 감사합니다 !! :) – Sirber

    답변

    0

    나는 drivers/adodb-sqlite3.inc.php을 편집했습니다. 함수 _connect()

    if (empty($argHostname) && $argDatabasename) $argHostname = $argDatabasename; 
    $this->_connectionID = new SQLite3($argHostname); // hack 
    if ($this->_connectionID === false) return false; 
    $this->_createFunctions();  
    return true; 
    

    내 작은 테스트 (활성 레코드 : 새 항목, 저장, 다시로드, 삭제)와 함께 작동하는 것 같습니다.