Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Update Query


Message #1 by "Frank Widjaja" <frans123@a...> on Sun, 7 Apr 2002 21:04:26
Hi -
I am a VB programmer that wants to learn more about ASP.

I hope someone can help me resolve the error message I got off the book I 
just purchased "Beginning ASP 3.0 - Chapter 14 - Page 580 - on Update 
Query - SQLUpdate.asp"

I am using a laptop with MS Windows 2000 server O/S and Access 2000.

Here is the error message when I ran the code off the internet explorer:

Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query. (????????)
/BegASP/Chapter14/SQLUpdate.asp, line 22

I checked the access file "Movie2000.mdb" thatthe read only permission is 
unchecked.

Here is the file - SQLUpdate.asp I downloaded off the web site:
<%
  Option Explicit
  Dim strConnect
%>
<!-- #include file="DataStore.asp" -->
<!-- METADATA TYPE="typelib" 
              FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -
->
<HTML>
<HEAD>
<TITLE>Using SQL's UPDATE Command and the ADO Command Object</TITLE>
</HEAD>
<BODY>
<% 
  Dim objComm, intNoOfRecords
  Set objComm = Server.CreateObject("ADODB.Command")

  Response.Write "<B>Harry the Ham directs Tarantino films? </B><BR>"
  objComm.ActiveConnection = strConnect
  objComm.CommandText="UPDATE AllMovies SET Director = 'Harry the Ham' " & 
_
                      "WHERE Director LIKE 'Quentin Tarantino'"
  objComm.CommandType=adCmdText
  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
%>
</BODY>
</HTML>

Any suggestion would be greatly appreciated.
~Frank




Message #2 by "Ken Schaefer" <ken@a...> on Mon, 8 Apr 2002 10:51:27 +1000
Please check the *NTFS* permissions for the actual .mdb Access file, and for
the folder that the file is in.
(right click on the folder, and choose "Security").

The anonymous internet user account (IUSR_<machinename>) needs permission to
change (RXWD) the actual .mdb file, and also to create and destory the .ldb
lockfile in that folder.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Frank Widjaja" <frans123@a...>
Subject: [access_asp] Update Query


: Hi -
: I am a VB programmer that wants to learn more about ASP.
:
: I hope someone can help me resolve the error message I got off the book I
: just purchased "Beginning ASP 3.0 - Chapter 14 - Page 580 - on Update
: Query - SQLUpdate.asp"
:
: I am using a laptop with MS Windows 2000 server O/S and Access 2000.
:
: Here is the error message when I ran the code off the internet explorer:
:
: Error Type:
: Microsoft JET Database Engine (0x80004005)
: Operation must use an updateable query. (????????)
: /BegASP/Chapter14/SQLUpdate.asp, line 22
:
: I checked the access file "Movie2000.mdb" thatthe read only permission is
: unchecked.
:
: Here is the file - SQLUpdate.asp I downloaded off the web site:
: <%
:   Option Explicit
:   Dim strConnect
: %>
: <!-- #include file="DataStore.asp" -->
: <!-- METADATA TYPE="typelib"
:               FILE="C:\Program Files\Common
Files\System\ado\msado15.dll" -
: ->
: <HTML>
: <HEAD>
: <TITLE>Using SQL's UPDATE Command and the ADO Command Object</TITLE>
: </HEAD>
: <BODY>
: <%
:   Dim objComm, intNoOfRecords
:   Set objComm = Server.CreateObject("ADODB.Command")
:
:   Response.Write "<B>Harry the Ham directs Tarantino films? </B><BR>"
:   objComm.ActiveConnection = strConnect
:   objComm.CommandText="UPDATE AllMovies SET Director = 'Harry the Ham' " &
: _
:                       "WHERE Director LIKE 'Quentin Tarantino'"
:   objComm.CommandType=adCmdText
:   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
: %>
: </BODY>
: </HTML>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index