I am having trouble with a basic PHP form using MS-Access 2000. I have stared at it for a while now and can't see what is wrong.
The connection works, it is just the sql execution that has issues. I can add info to the data base from an MS-Access form without any issues. I have checked all the names and I can't see any typo's.
I would appreciate some advise here. Thanks.
Output & error message:
-----------------------
|INSERT INTO contacts (givenname, surname, company, email, details) VALUES ('Joe', 'Bloggs', 'Smith & Co', '[email protected]', 'The Quick Brown fox jumped over the lazy dog 1234567890')|
Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in c:\inetpub\wwwroot\thankyou.php on line 20
An error inserting your data was detected.
Code:
-----
// Connect to database
$connect = odbc_connect("contacts", "", "");
// Check to see if sql command was successful
if($results)
echo "Thank you for completing your details.";
else
echo "An error inserting your data was detected.";
// close connection to the database
odbc_close($connect);
} else {
echo "Connection to database failed";
}
?>
You haven't mentioned the platform (I know its windows, but whether Win2K or XP) so here are both solutions..it has to do with file permissions on the folders
win 2000
For those of us using NTFS on our servers along with IIS and Access, the anonymous web user account (IUSR_Computername) must have write permissions (NTFS not IIS) to the database file itself. As soon as I changed mine, the thing just flew through the installation like it should have in the first place
XP
Actually XP requires an extra step you have to enable the security tab before you can set permissions - go to tools>folder options, click the view tab, scroll all the way to the bottom and uncheck Use simple file sharing (Recommended). Voila! Security tab Then just right-click your filename, choose properties, security tab, add, type in IUSR_YourComputerName, click OK, then check off modify. Hit OK and run the install again.
When try writing form data to a text file in XP, I get the error
"403 Forbbiden You don't have permission to access /phpApp/add_File.php" on this serve.
I'm not sure where I click on tools from. I went the phpAPP directory and clicked on tools>folder options. I don't see the
"Use simple file sharing" option to uncheck.
Is there somewhere else I should be starting from, before I click on Tool> etc?