View Single Post
  #1 (permalink)  
Old February 2nd, 2004, 06:54 PM
JB977 JB977 is offline
Registered User
Join Date: Jan 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 14--SQLUpdate.asp Try it out

I seem to have hit a road block on this try it out. I am getting an error when I run this in my browser:

Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/aspfiles/sqlupdate.asp, line 30

I checked the code many times even letter by letter. (I missed a punctuation in chapter 12) and everything checks out. I even used the code from the Wrox downloads. Same error.

Here is the code:

    option explicit
    dim strConnect


<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Using SQL's UPDATE Command and the ADO Command Object</title>

    dim objComm, intNoOfRecords
    Set objComm = Server.CreateObject("ADODB.Command")

    Response.Write "<B>Harry the Ham directs Quentin Tarantino films?</b><br>"
    objComm.ActiveConnection = strConnect

    objComm.CommandText = "UPDATE AllMovies SET Director = 'Harry the Ham' " &_
                        "WHERE Director LIKE 'Quentin Tarantino'"
    objComm.Execute intNoOfRecords

    Response.Write "This UPDATE command has affected " & intNoOfRecords & " records<br><br>"

    Response.Write "<b>Tarantino returned to his rightful place as director:</b><br>"
    objComm.CommandText = "UPDATE AllMovies SET Director = 'Quentin Tarantino' " &_
                        "WHERE Director LIKE 'Harry the Ham'"

    objComm.Execute intNoOFRecords
    Response.Write "This UPDATE command has affected " & intNoOfRecords & " records<br><br>"

    Set objComm = Nothing


I checked the Access files and nothing seems to be configured to make the database "un-updateable"

Any ideas?

BTW there is nothing on the errata list I downloaded from this site (it has chapter 8's errors then skips to chapter 15 for the application)