Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2002
    Posts
    13

    Unanswered: Operation must use an updateable query Error

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query -

    /bsci99/pwalsh/Add Records ASP/addrecordsql2.asp, line 20

    I am gettin this error while trying to run a simple ASP page to insert records into a DB...

    anyone know where im going wrong..?

    this is the relevent line of code:

    20 - conn.execute(strSQL)
    21 - conn.close
    22 - set conn = nothing

  2. #2
    Join Date
    Feb 2002
    Location
    North Wales, UK
    Posts
    114
    Please post the actual database connection code your using and the query that the page is trying to run.
    J^ - web | email
    newsASP Developer

  3. #3
    Join Date
    Nov 2002
    Posts
    11
    Without seeing the actual code like Jonathan asked for, I'm betting it's a permissions issue.

    Make sure that the IUSR_<machinename> account has Write permissions to your Access Database file (since it's probably outside the web site).

    Hope this helps...
    - Brandon

  4. #4
    Join Date
    Nov 2002
    Posts
    13
    Here is the actual connection code & SQL code:

    Code:
    <%@ Language = "VBScript"%>
    <%
    'Declare all local variables
    dim conn
    dim rs
    dim strconn
    dim strsql
    
    strsql = ""
    'set connection string to local variable-I use a DSN-less connection
    strconn = "DRIVER={Microsoft Access Driver (*.mdb)};
    DBQ=" & Server.MapPath("adoandsqladd.mdb");
    
    'build the sql statement based on the input from the form
    strSQL = "INSERT INTO tblSqlAdd(FirstName, LastName, FavoriteColor) Values('" & request("FirstName") & "', '" & request("LastName") & "', '" & request("Favoritecolor") & "')"
    
    'Set connection object 
    set conn = server.createobject("adodb.connection")
    conn.open strconn
    'Use the execute method of the connection object the insert the record
    conn.execute(strSQL)
    conn.close
    set conn = nothing
    %>
    Hopes this gives you guys a better idea of my problem,
    Philby

  5. #5
    Join Date
    Nov 2002
    Posts
    11
    The code looks right to me...

    Do you have access to the server? If so, check the permissions on the database. Open Windows Explorer, go to the database file, right-click it, select Properties and then click on the permissions tab. In the top box, you should see a user named IUSR_... Click it and then look at the checkboxes at the bottom. Make sure that the Write box is checked. If you don't see an IUSR_ account, the server is probably using the Everyone group to access the file, so you'll need to add IUSR_ to the list. Click Add then select IUSR from the list. Make sure that you give IUSR_ read and write access (should be the same as Everyone, plus the Write checkbox).

    Hope this helps...
    - Brandon

  6. #6
    Join Date
    Nov 2002
    Posts
    13
    hey brandon,

    I've done that (and converted the DB to Access 2002 from '97) but no I have this error:

    Code:
    Microsoft VBScript compilation error '800a0409' 
    
    Unterminated string constant 
    
    /bsci99/pwalsh/Add Records ASP/addrecordsql2.asp, line 16 
    
    strconn = "DRIVER={Microsoft Access Driver (*.mdb)};
    god...if it isnt one thing its another!!

  7. #7
    Join Date
    Nov 2002
    Location
    Ohio
    Posts
    90
    If DBQ=" starts on the next line

    ...shouldn't it have a continuation character on the previous line?
    Bruce Baasch

  8. #8
    Join Date
    Nov 2002
    Posts
    11
    Yep. You're missing some quotes...

    It should look like this...

    Code:
    ...
    strconn = "DRIVER={Microsoft Access Driver (*.mdb)};" &_
              "DBQ=" & Server.MapPath("adoandsqladd.mdb") & ";"
    ...
    The &_ is a continuation character for VBScript strings (meaning use the stuff on the next line too).

    Give this a try...
    - Brandon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •