p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: RE: Field cannot be updated.


Message #1 by "Drew, Ron" <RDrew@B...> on Fri, 14 Jun 2002 07:46:24 -0400
I think you need a select

	inRecordID =3D request.Form("virusitem")
	set objRS=3Dserver.createobject("adodb.recordset")
	objRS.Open "SELECT * FROM Viruses WHERE Virus_Item =3D " &
inRecordID, strConnect, 1,2
	objRS("Title") =3D request.Form("title")
	objRS.Update
=09
=09
-----Original Message-----
From: Gary Schultz [mailto:gschultz@n...]
Sent: Thursday, June 13, 2002 6:46 PM
To: ASP Databases
Subject: [asp_databases] Field cannot be updated.


Had a problem earlier in which i was receiving an "object is read only"
error.  Resolved that issued by disable simple file sharing in XP which
allowed me to more completely set the permissions of the folder in which

my .mdb is located.  Now that I've resolved that, I get the following
error:

Error Type:
Microsoft JET Database Engine (0x80040E21)
Field cannot be updated.

Source code is as follows:

<%
	dim objRS, intRecordID
=09
	set objRS=3Dserver.createobject("adodb.recordset")
	objRS.Open "Viruses", strConnect, adOpenStatic,
adLockOptimistic,
adCmdTable
	inRecordID =3D request.Form("virusitem")
=09
	objRS("Virus_Item") =3D intRecordID
	objRS("Title") =3D request.Form("title")
	objRS.Update
	objRS.Close
	set objRS =3D nothing

	set objComm =3D nothing
%>

any suggestions would be appreciated.  Thank you in advance

Gary Schultz
Message #2 by Shawn_McCabe@c... on Thu, 13 Jun 2002 14:56:27 -0700
No problem.




From: "Gary Schultz" <gschultz@n...> on 06/13/2002 11:06 PM GMT

Please respond to "ASP Databases" <asp_databases@p...>

To:       "ASP Databases" <asp_databases@p...>
cc:

Subject:  [asp_databases] Re: Field cannot be updated.


worked like a charm, shawn, thanks!

now if i only knew what the hell that did :-)

GDS






Message #3 by "Gary Schultz" <gschultz@n...> on Thu, 13 Jun 2002 22:45:56
Had a problem earlier in which i was receiving an "object is read only" 
error.  Resolved that issued by disable simple file sharing in XP which 
allowed me to more completely set the permissions of the folder in which 
my .mdb is located.  Now that I've resolved that, I get the following 
error:

Error Type:
Microsoft JET Database Engine (0x80040E21)
Field cannot be updated.

Source code is as follows:

<%
	dim objRS, intRecordID
	
	set objRS=server.createobject("adodb.recordset")
	objRS.Open "Viruses", strConnect, adOpenStatic, adLockOptimistic, 
adCmdTable
	inRecordID = request.Form("virusitem")
	
	objRS("Virus_Item") = intRecordID
	objRS("Title") = request.Form("title")
	objRS.Update
	objRS.Close
	set objRS = nothing

	set objComm = nothing
%>

any suggestions would be appreciated.  Thank you in advance

Gary Schultz
Message #4 by Shawn_McCabe@c... on Thu, 13 Jun 2002 14:36:38 -0700
This should help.
          <%
               Dim oConn      ' object for ADODB.Connection obj
               Dim oRs             ' object for output recordset object
               Dim curDir          ' Directory of authors.mdb file


               ' Map authors database to physical path
               curDir = Server.MapPath("\iissamples\sdk\asp\database\authors.mdb")


               ' Create ADO Connection Component to connect with sample database
               Set oConn = Server.CreateObject("ADODB.Connection")
               oConn.Open "DBQ="& curDir &";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;"


               ' Create ADO Recordset Component, and associate it with ADO connection
               Set oRs = Server.CreateObject("ADODB.Recordset")
               Set oRs.ActiveConnection = oConn


               ' Get empty recordset
               oRs.Source = "SELECT * FROM authors"
               oRs.CursorType = adOpenStatic            ' use a cursor other than Forward Only
               oRs.LockType = adLockOptimistic               ' use a locktype permitting insertions
               oRs.Open


               ' Change values in first record found
               oRs("Author").Value = "Scott Guthrie"
               oRs("Yearborn").Value = 1975
               oRs.Update
          %>




From: "Gary Schultz" <gschultz@n...> on 06/13/2002 10:45 PM GMT

Please respond to "ASP Databases" <asp_databases@p...>

To:       "ASP Databases" <asp_databases@p...>
cc:

Subject:  [asp_databases] Field cannot be updated.


Had a problem earlier in which i was receiving an "object is read only"
error.  Resolved that issued by disable simple file sharing in XP which
allowed me to more completely set the permissions of the folder in which
my .mdb is located.  Now that I've resolved that, I get the following
error:

Error Type:
Microsoft JET Database Engine (0x80040E21)
Field cannot be updated.

Source code is as follows:

<%
     dim objRS, intRecordID

     set objRS=server.createobject("adodb.recordset")
     objRS.Open "Viruses", strConnect, adOpenStatic, adLockOptimistic,
adCmdTable
     inRecordID = request.Form("virusitem")

     objRS("Virus_Item") = intRecordID
     objRS("Title") = request.Form("title")
     objRS.Update
     objRS.Close
     set objRS = nothing

     set objComm = nothing
%>

any suggestions would be appreciated.  Thank you in advance

Gary Schultz






Message #5 by "Gary Schultz" <gschultz@n...> on Thu, 13 Jun 2002 23:06:45
worked like a charm, shawn, thanks!

now if i only knew what the hell that did :-)

GDS

  Return to Index