April 5th, 2003, 10:54 AM
Unable to Update an Access Database
I am trying to update an Access database through an ASP page. After researching the internet, the general consensus is that permissions are not correctly being set on the .mdb file that I am trying to update.
I am using WinXP Pro. I have went into Start->Control Panel->Administrative Tools->Computer Management and went into the IIS drop down and went into my websites directory. I selected the .mdb file through the interface and selected the properties option and set the file permissions to read and write. I did the same to the directory that the .mdb file is located. Just as a test, I gave the .asp page read and write permissions (I know that this is not a good practice, I was just doing it as a test).
When I run the asp page, I get the following error:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query
Here is the code that generates the message:
title = Request.QueryString("txtTitle")
website = Request.QueryString("txtWebsite")
comments = Request.QueryString("txtComment")
' Construct the database connection
set dbConnection = Server.CreateObject("ADODB.Connection")
dbConnection.Provider = "Microsoft.Jet.OLEDB.4.0"
dbConnection.Open Server.MapPath("..") & "/db/website.mdb"
' Insert album information
sql = "INSERT INTO Albums (title, website, comments) VALUES ('" & title & "', '" & website & "', '" & comments & "')"
set dbConnection = Nothing
Thank-you for any help you can provide.
April 7th, 2003, 04:34 PM
Well your on the right track it sounds like. Make sure that you have given permissions for read & write to the user IUSER_<computer name> account. What you may also need to do is give that user read and write to the entire directory in which the database is stored. If you have already done this then you may want to double check and make sure you stop and restart the service. That should do it.
April 8th, 2003, 09:34 PM
That seemed to fix it