duanma8207 2015-09-07 15:49
浏览 51

Codeigniter无法访问OSX上的ODBC Microsoft Access

Im trying to solving this since 1 week ago.. On this case, i want to use CRUD with MS ACCESS Database (.mdb) on OSX Yosemite.

Everything is running well on My Windows, but when checkout my CI Project on Mac OSX Yosemite, my project show no error when i load database access.

When i use ODBC Manager on OSX, it said "Test Completed Successfully". But still show anything when i running those project :(

this is my sample code for database configuration

$db['dba']['hostname'] = 'attBackup';
$db['dba']['username'] = '';
$db['dba']['password'] = '';    
$db['dba']['database'] = 'attBackup';
$db['dba']['dbdriver'] = 'odbc';
$db['dba']['dbprefix'] = '';
$db['dba']['pconnect'] = TRUE;
$db['dba']['db_debug'] = TRUE;
$db['dba']['cache_on'] = FALSE;
$db['dba']['cachedir'] = '';
$db['dba']['char_set'] = 'utf8';
$db['dba']['dbcollat'] = 'utf8_general_ci';
$db['dba']['swap_pre'] = '';
$db['dba']['autoinit'] = TRUE;
$db['dba']['stricton'] = FALSE;

anyone have some solution for this case? thanks gbu

  • 写回答

1条回答 默认 最新

  • doushu7588 2015-09-08 02:27
    关注

    Try setting up a DSN and changing to the following:

    $db['access']['hostname'] = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\DB.mdb"; //dsn name
    $db['access']['username'] = "";
    $db['access']['password'] = "";
    $db['access']['database'] = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\DB.mdb";
    

    There's also a section in the CodeIgniter documentation that addresses connection strings:

    The Documentation Of CI That addresses this is here

    Hope may this help

    If still having problem then Check

    check read/write permissions etc

    评论

报告相同问题?

悬赏问题

  • ¥30 自适应 LMS 算法实现 FIR 最佳维纳滤波器matlab方案
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像