使用msaccess的PHP [英] php using msaccess

查看:47
本文介绍了使用msaccess的PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为没有人回答我的问题使用ms访问数据库的Codeigniter ,我提出了新的要求问题我不使用codeigniter

Because no one answer my question Codeigniter using ms access database , i make new question i not using codeigniter

如果我从计算机上使用mdb可以正常工作,但是如果我从网络中的另一台计算机上使用mdb

if I using mdb from my computer it works but if i using mdb from another computer in my network

我遇到错误,这是我的密码

i got error this is my CODE

<?php

$connect = odbc_connect("testdb", "", "");
$query = "SELECT * FROM ACGroup";
$result = odbc_exec($connect, $query);

while(odbc_fetch_row($result)){
  $name = odbc_result($result, 1);
  echo("$name");
}

?>

我将odbc放在我网络中另一台计算机的数据上

i make odbc where the data its from another computer in my network

"testdb" are data sourcename and database \\ip\folder\testdb.mdb

我收到了这个错误

   Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Microsoft Access Driver] 
    The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.,
     SQL state S1000 in SQLConnect in D:\blabla\coba.php on line 3

我已经尝试了文件夹设置,但是它不起作用

I already try folder setting but it not work

推荐答案

问题可能出在您的Apache用户对mdb文件的权限上.

The problem possibly lies in the permissions your Apache user has on the mdb file.

转到您的mdb文件,在文件上右键单击->属性->安全性"选项卡,然后查看您的Apache用户是否在对mdb文件具有访问/控制权限的用户组中.

Go to your mdb file, right-clik on the file -> Properties ->Security tab and see if your Apache user is on the User Groups that have access/control on the mdb file.

为了查看/更改您的Apache用户,请转到控制面板"->管理工具"->服务",右键单击"Apache服务"->属性"->登录"选项卡.在登录身份"选项中,查看所选用户是否属于有权访问mdb文件的用户组.如果不是,请创建一个并将其添加到用户组中,然后将其用作Apache帐户.

In order to see/change your Apache user, go to Control Panel-> Administrative Tools -> Services, right-click on Apache service -> Properties -> Logon tab. In the Log on as option, see if the user selected belongs to the User Groups that have access to mdb file. If not, create one and add it to the User Groups and then use it as the Apache account.

这篇关于使用msaccess的PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆