laserlight;10949617 wrote:You forgot a terminating semi-colon on the previous line:
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or exit('Cannot open Database')
GREAT! Thanks for that, that got past that bit. But I have a new error. I releasied the code still wasn't quite right, so I added this: -
$conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');
$db = '\\\\wtwelwynfile\\shared\\IT\\Call Logger\\Call Centre.mdb';
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or exit('Cannot open with Jet.');
The error I am now getting is:-
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft JET Database Engine<br/><b>Description:</b> The Microsoft Jet database engine cannot open the file '\wtwelwynfile\shared\IT\Call Logger\Call Centre.mdb'. It is already opened exclusively by another user, or you need permission to view its data.' in C:\wamp\www\opencalls.php:20 Stack trace: #0 C:\wamp\www\opencalls.php(20): com->Open('Provider=Micros...') #1 {main} thrown in C:\wamp\www\opencalls.php on line 20
This is the entire code again. Thanks in advance again:-
<head>
<link rel="stylesheet" type="text/css" href="/styles/static/stylesheet.css" />
</head>
<div>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<p>
<?php
$conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');
$db = '\\\\wtwelwynfile\\shared\\IT\\Call Logger\\Call Centre.mdb';
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db") or exit('Cannot open with Jet.');
$sql = "SELECT * FROM [Call Details] WHERE ((([Call Details].Private)=No) AND (([Call Details].Status)='Open') AND (([Call Details].[Call Type])='Request')) ORDER BY [Call Details].[Reference Number] DESC";
$rs = $conn->Execute($sql);
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table x:str border=0 cellpadding=0 cellspacing=0 style='border-collapse:
collapse;table-layout:fixed;width:618pt'><tr>";
echo "<th width=50 align=left ><u>Ref No.:</u></th>";
echo "<th width=50 align=left ><u>Priority</u></th>";
echo "<th width=150 align=left ><u>Users_Name</u></th>";
echo "<th width=100 align=left ><u>Type</u></th>";
echo "<th width=100 align=left ><u>Assigned To</u></th>";
echo "<th width=400 align=left ><u>Problem_Description</u></th>";
echo "<th width=400 align=left ><u>Update</u></th>";
while (odbc_fetch_row($rs))
{
$refname=odbc_result($rs,"Reference Number");
$priortiyname=odbc_result($rs,"Priority");
$username=odbc_result($rs,"Users_Name");
$calltypename=odbc_result($rs,"Call Type");
$assignedtoname=odbc_result($rs,"Assigned To");
$probesname=odbc_result($rs,"Problem_Description");
$updatename=odbc_result($rs,"Update");
echo "<tr width=50 align=left valign=top><td>$refname</td>";
echo "<td width=50 align=left valign=top>$priortiyname</td>";
echo "<td width=150 align=left valign=top>$username</td>";
echo "<td width=100 align=left valign=top>$calltypename</td>";
echo "<td width=100 align=left valign=top>$assignedtoname</td>";
echo "<td width=400 align=left valign=top>$probesname</td>";
echo "<td width=400 align=left valign=top>$updatename</td>";
}
odbc_close($conn);
echo "</table>";
?>
</p>
</div>
<span class="corners-bottom"><span></span></span>
</div>
</div>
</div>