
April 5th, 2003, 09:54 AM
|
|
Junior Member
|
|
Join Date: Jan 2003
Posts: 24
Time spent in forums: 7 sec
Reputation Power: 0
|
|
|
Unable to Update an Access Database
Hello,
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 & "')"
dbConnection.Execute sql
dbConnection.Close
set dbConnection = Nothing
Thank-you for any help you can provide.
|