hi there,
Firstly let me say sorry for posting this in two places - this morning when I posted this in the beginning PHP forum, I wasnt paying attention to what I was doing and put it there instead of in this forum -

! Sorry.
Here is a description of the problem i am having:
Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource inwebserver\webroot\test\thought.php on line 14. Error in SQL
As far as I understand, the query is correct and I have . Below is the code which I am using:
<?php
$conn = new COM('ADODB.Connection');
$db = 'webserver\morrislgn\database\firstchurch.mdb';
$conn->Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=$db");
if (!$conn)
{
exit("Connection Failed: " . $conn);
}
$date = date("jm");
$sql="SELECT * FROM thoughts where date = $date";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{
exit( "Error in SQL" );
}
echo ( "<table>" );
while (odbc_fetch_row($rs))
{
$date = odbc_result ( $rs, "Date" );
$title = odbc_result ( $rs, "Title" );
$ref = odbc_result ( $rs, "Reference" );
$thought = odbc_result( $rs, "Thought" );
$author = odbc_result( $rs, "Author" );
and the code goes on to write the info to the page through a series of echo commands.
When I wrote this to work on my local machine, it worked fine, but then I had to change t a couple of lines at the top about the connection to make it work on my web server. However, since making the changes, it refuses to work and I dont understand why?
Any ideas, workarounds or suggestions for better ways to code this?
cheers,
Morris