Results 1 to 2 of 2

Thread: error updating to access db

  1. #1
    Join Date
    Dec 2004
    Posts
    152

    error updating to access db

    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.

    Code:
     
    <% 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   
    %>
    Last edited by numbenator; 11 Aug 2005 at 10:31 AM.

  2. #2
    Join Date
    Mar 2004
    Location
    Derby, UK
    Posts
    102
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •