#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    24
    Rep 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.
  2. #2
  3. No Profile Picture
    Overly white
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Fresno, CA
    Posts
    83
    Rep Power
    12
    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.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Posts
    24
    Rep Power
    0

    Thanks


    Thanks,

    That seemed to fix it

IMN logo majestic logo threadwatch logo seochat tools logo