所以我使用訪問數據庫(* mdb)。 這是我的代碼,併成功連接:Codeigniter使用ms訪問數據庫
$db['test']['hostname'] = 'Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\blabla.mdb';
$db['test']['username'] = '';
$db['test']['password'] = '';
$db['test']['database'] = 'Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\blabla.mdb';
$db['test']['dbdriver'] = 'odbc';
$db['test']['dbprefix'] = '';
$db['test']['pconnect'] = TRUE;
$db['test']['db_debug'] = TRUE;
$db['test']['cache_on'] = FALSE;
$db['test']['cachedir'] = '';
$db['test']['char_set'] = 'utf8';
$db['test']['dbcollat'] = 'utf8_general_ci';
$db['test']['swap_pre'] = '';
$db['test']['autoinit'] = TRUE;
$db['test']['stricton'] = FALSE;
,現在我想用ACCESSDB從其他計算機。 這個accessdb(* mdb)已被共享,我製作了地圖網絡驅動器(Z :)。
所以我改變主機名和數據庫,但它的失敗:
$db['test']['hostname'] = 'Driver={Microsoft Access Driver (*.mdb)};DBQ=Z:\blabla.mdb';
$db['test']['database'] = 'Driver={Microsoft Access Driver (*.mdb)};DBQ=Z:\blabla.mdb';
我嘗試這:
$db['test']['hostname'] = 'Driver={Microsoft Access Driver (*.mdb)};DBQ=\\10.0.0.107\share\blabla.mdb';
$db['test']['database'] = 'Driver={Microsoft Access Driver (*.mdb)};DBQ=\\10.0.0.107\share\blabla.mdb';
但它仍然錯誤:
Unable to connect to your database server using the provided settings.
Filename: D:\folder\folder\system\database\DB_driver.php
Line Number: 124
,甚至我嘗試連接php ,這是結果php using msaccess
可能會有幫助:http://stackoverflow.com/questions/178860/code-igniter-cakephp-and-ms-access – Fionnuala
@Remou已經閱讀之前,使這個問題:( – Belajar
@duskwuff我不想要,但它的用戶請求 – Belajar