
July 27th, 2009, 05:00 PM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 1
Time spent in forums: 55 m 41 sec
Reputation Power: 0
|
|
|
PHP/Access/ 37000 error
I get this error only when I run the code on my local development machine. On the server I did not have a problem with this code. Local machine is Windows XP Pro, IIS 5.1 (CGI/FastCGI), PHP 5.2.9-1, Access 2003. Server is Win 2000, IIS 5.0 (CGI/FastCGI), PHP 5.2.6, Access 2003.
Here's the error message with connection check:
Quote: connection workedResource id #1
SELECT subcat3 FROM cat-php2
Error in SQLPHP Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Unknown, SQL state 37000 in SQLExecDirect in C:\Inetpub\wwwroot\solutions-php\harvest.php on line 27 |
Here's the code:
Quote: $conn = odbc_connect('faq_solutions','',''); //connects to database
if (!$conn)
{
exit("Connection Failed: " . $conn);
}
else
{
echo "connection check: connection worked". $conn . "<br><br>";
}
$sql = "SELECT subcat3 FROM cat-php2";
echo "SQL statement: $sql <br> \n";
$rs = odbc_exec($conn, $sql);
if (!$rs) //verifies query ran successfully
{exit("Error in SQL");} |
I have made sure that IUSR_mycomputer has full modify rates to the folder and to the database within that folder. That did not resolve my problem. It seems unlikely that this is a syntax error. I've searched on this error but much of what comes up points to syntax errors which seems unlikely in this situation since it works on the server. Any help will be appreciated.
Thanks in advance.
Last edited by Red_Emma : July 27th, 2009 at 05:04 PM.
|