พอเขียน php เพื่อติดต่อกับAccess
<?
$dsn_name = "customer";
$username ="";
$password ="";
$connect= odbc_connect($dsn_name, $username, $password) or die("ติดต่อ DSN ไม่ได้");
$sql = "select * from customer";
$execute = odbc_exec($connect, $sql) or die ("เอ็กซิคิวส์คำสั่งไม่ได้");
?>
<table border="1" width="371">
<tr>
<td width="32">
<div align="center">id</div>
</td>
<td width="132">
<div align="center">name</div>
</td>
<td width="185">
<div align="center">surname</div>
</td>
</tr>
</table>
<?
$i=1;
while(odbc_fetch_row($execute,$i))
{
$id=odbc_result($execute,"id");
$name=odbc_result($execute,"name");
$surname=odbc_result($execute,"surname");
?>
<table border="1" width="370">
<tr>
<td width="35">
<div align="center">
<? echo "$id"; ?>
</div>
</td>
<td width="129">
<? echo "$name"; ?>
</td>
<td width="184">
<? echo "$surname"; ?>
</td>
</tr>
</table>
<?
แล้วพอRun เกิดปัญหา ขึ้นข้อความว่า
Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'customer'. Make sure it exists and that its name is spelled correctly., SQL state S0002 in SQLExecDirect in c:\appserv\www\sample 62.php on line 7
เอ็กซิคิวส์คำสั่งไม่ได้
เกิดจากสาเหตุอะไร แก้ไม่ถูก
Tag : - - - -