doushi1510 2016-09-09 05:03
浏览 18

php连接微软访问密码

I have to connect to an old Microsoft Access database that has only the database password that is used on a desktop program, so I have no variation with to convert it to mysql, this is my attempt to connect:

<?php
    $dbName = "dati.mdb";
    $user = "";
    $password = "gmpa";
    $connection = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$dbName"$user,$password);
?>
  • 写回答

1条回答 默认 最新

  • doufutao4428 2016-09-09 06:02
    关注

    This is the correct syntax for odbc:

    $db = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=dati.mdb", '', 'gmpa');
    

    If it fails, try with the default username "Admin":

    $db = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=dati.mdb", 'Admin', 'gmpa');
    

    If it still fails, you probably need to specify the full path to the database file, for example:

    $db = odbc_connect("Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\\Users\\You\\Desktop\\dati.mdb;", 'Admin', 'gmpa');
    
    评论

报告相同问题?

悬赏问题

  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?