PDA

View Full Version : error updating to access db



numbenator
11 Aug 2005, 11:16 AM
Hi all,

I am getting an error on the below :

Im a little confused as to why though. If i remove the line
rs.Fields("studentName") = request.form("studentName")
& rs.Update
then i have no error. Could someone please give me some direction.



<% response.Expires=0 %>



<!--#include file="SSI/_conn.asp"-->

<% Dim rs, updateSQL
Set rs = Server.CreateObject("ADODB.RecordSet")
updateSQL = "SELECT * FROM comments"
rs.open updateSQL, Conn
rs.MoveFirst
rs.Fields("studentName") = request.form("studentName")
rs.Update
rs.Close
%>

DaiWelsh
16 Aug 2005, 04:51 AM
What is the error message? There are a number of possibilities, one is that the recordset needs to be a certain type for this method of updating to work (I don't work this way so I am not certain), another is that it is because you are not using the values of the objects e.g.

rs.Fields("studentName").value = request.form("studentName").value

may work better.