Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: error inserting a record


Message #1 by jodytregenna@y... on Sat, 8 Mar 2003 09:39:02
Hi,
All week I have this one error and i cannot find the problem, hope someone 
can help.

I fill in a form then try to insert the new details into an Access db. I 
keep getting the error:

******************************************

Microsoft JET Database Engine error '80004005' 

Operation must use an updateable query. 

/project/processadd.asp, line 15 

******************************************

Line 15 is the execute SQL statement. I have narrowed the error down to 
the request.form("ysnonloan") part of the sql query by changing the field 
property in the access db to text and not a yes/no field.

The following sql statement is created:
INSERT INTO tbl_resource VALUES 
('123455','Music' ,'Jack','Newton' ,'Hall','1990' ,'Pop','on' ,'test','002.
1 EDW' ,'21') 

*************** code below for inserting into the db ****************


<% 'process insert of resource into db

Dim SQL
  SQL = "INSERT INTO tbl_resource " & _ 
  "VALUES ('" & request.form("txtisbn") & "','" & request.form("txttitle") 
& "' " & _
  ",'" & request.form("txtauthorfore") & "','" & request.form
("txtauthorsur") & "' " & _
  ",'" & request.form("txtpublisher") & "','" & request.form
("intdate_published") & "' " & _
  ",'" & request.form("txtcategory") & "','" & request.form("ysnonloan") 
& "' " & _
  ",'" & request.form("txtkeywords") & "','" & request.form
("txtdewey_ref") & "' " & _
  ",'" & request.form("txtloan_days") & "')"

response.Write(SQL)
objConn.Execute(SQL)

  'closes the database connection  
  objConn.Close
  set objConn = Nothing  
%>



Hope someone can help, much appreciated...
Jody
Message #2 by "Jan Manne" <janmanne@h...> on Thu, 13 Mar 2003 15:22:48 -0500
I have Same problem in dreamweaverwith asp and access. You may not have 
permissions in the database to write record.I have same problem when i am 
inserting  record.  right click on the drive(ex:My server is on
c;/Inetpub/wwwroot)right click on Inetpub and  go to security.There are so 
many options U need to chek mark all of the options.And also you need to 
have read and write permissions to the database in the server,If it is in 
remote area.  I hope this will help.




>From: jodytregenna@y...
>Reply-To: "Access ASP" <access_asp@p...>
>To: "Access ASP" <access_asp@p...>
>Subject: [access_asp] error inserting a record
>Date: Sat, 8 Mar 2003 09:39:02
>
>Hi,
>All week I have this one error and i cannot find the problem, hope someone
>can help.
>
>I fill in a form then try to insert the new details into an Access db. I
>keep getting the error:
>
>******************************************
>
>Microsoft JET Database Engine error '80004005'
>
>Operation must use an updateable query.
>
>/project/processadd.asp, line 15
>
>******************************************
>
>Line 15 is the execute SQL statement. I have narrowed the error down to
>the request.form("ysnonloan") part of the sql query by changing the field
>property in the access db to text and not a yes/no field.
>
>The following sql statement is created:
>INSERT INTO tbl_resource VALUES
>('123455','Music' ,'Jack','Newton' ,'Hall','1990' ,'Pop','on' ,'test','002.
>1 EDW' ,'21')
>
>*************** code below for inserting into the db ****************
>
>
><% 'process insert of resource into db
>
>Dim SQL
>   SQL = "INSERT INTO tbl_resource " & _
>   "VALUES ('" & request.form("txtisbn") & "','" & request.form("txttitle")
>& "' " & _
>   ",'" & request.form("txtauthorfore") & "','" & request.form
>("txtauthorsur") & "' " & _
>   ",'" & request.form("txtpublisher") & "','" & request.form
>("intdate_published") & "' " & _
>   ",'" & request.form("txtcategory") & "','" & request.form("ysnonloan")
>& "' " & _
>   ",'" & request.form("txtkeywords") & "','" & request.form
>("txtdewey_ref") & "' " & _
>   ",'" & request.form("txtloan_days") & "')"
>
>response.Write(SQL)
>objConn.Execute(SQL)
>
>   'closes the database connection
>   objConn.Close
>   set objConn = Nothing
>%>
>
>
>
>Hope someone can help, much appreciated...
>Jody


_________________________________________________________________



  Return to Index