Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Operation must use an updateable query. (2000)

    I have a web site that uses asp to update an Access database. I am getting an 'Operation must use an updateable query' error message from a simple INSERT statement, when the statement is run from the asp script. However, when I paste the same statement into the SQL window of a query, in the same database, it appends a record to the database as expected. The SQL ststement is:

    INSERT INTO tbl_Articles (Title, Authors, Source, PubDate, Synopsis, ArticleText, IncludeInNextEmail, MenuLevel1, MenuLevel2, MenuLevel3, PDFFile) VALUES ('test', Null, Null, Null, Null, Null, True, 0, 0, 0, Null);

    Th primary key of the table being updated (tbl_Articles) is an Autonumber field not mentioned in the query.
    I'm not sure where updateable queries come into this, a simple append of one table without any references to other tables, so I'm guessing that the error message might be a red herring. I can't think where else to look though.

    Any ideas? Thanks in advance.

    Ian

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Operation must use an updateable query. (2000)

    Try taking out the Null fields as a first step.

  3. #3
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Operation must use an updateable query. (2000)

    I tried taking out the nulls, but it didn't work. I still get the same error message returned in the browser. However, if I change the code so that the SQL string is displayed in the browser, then paste that string into an Access query, the query runs and a record is appended to the table. Just for the record, the last string this happened to was:

    INSERT INTO tbl_Articles (Title, Authors, PubDate, IncludeInNextEmail) VALUES ('Test', 'Me & Him', # January 01 2003#, True);

    Not a complete waste of time, I've now got much better code that doesn't create the bits of the SQL string that it doesn't need (no more Nulls), but the query string it produces still doesn't work in asp.

    Just in case the error might be elsewhere, this is how I try to run the query from the asp script:

    Dim cnn, strSQL, bolInclude, datPubDate, lngMenuLvel
    Dim strFieldList, strValues, lngResult

    Set cnn = Server.CreateObject("ADODB.Connection")
    cnn.Open strCnn

    strSQL = "INSERT INTO tbl_Articles ("

    ..... Code to create the rest of the SQL string, based on how much of the calling form was completed ......

    cnn.Execute(strSQL)
    Response.Redirect("admin.asp")

    Am I doing something else wrong?

    Ian

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Operation must use an updateable query. (2000)

    I don't know any thing about ASP, so I'm no further help here, sorry.

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Operation must use an updateable query. (2000)

    I notice that you asked a similar question back last January, and Hans provided <post#=332420>post 332420</post#> which helpted then.

    Have you looked back at these suggestions again?
    Regards
    John



  6. #6
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Operation must use an updateable query. (2000)

    That was it - the Internet user account wasn't set up with the necessary permissions. Again! Thanks.
    By the way, have you thought of starting a cabaret career as The Amazing Memory Man?

Posting Permissions

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