Add new record to Access Database problem

Results 1 to 2 of 2

Thread: Add new record to Access Database problem

  1. #1
    John T. White Guest

    Default Add new record to Access Database problem

    Here is the ASP code that I am using. I had the script display the "LastName" from the form so the information from the form is coming over to the script. But when I try to have it add a new record to the MS Access Database, it gives me this error:<BR><BR>ADODB.Recordset error &#039 800a0c93&#039 <BR><BR>The operation requested by the application is not allowed in this context. <BR><BR>/newenroll.asp, line 11 <BR><BR><BR>Here is the coding:<BR><BR>&#060;%<BR>UserQuery = "SELECT * FROM MPS"<BR><BR>UserConn="FILEDSN=user.dsn"<BR>set UserRS=Server.CreateObject("ADODB.recordset")<BR>U UserQuery, UserConn, 3, 2<BR><BR>UserRS.addnew<BR>UserRS("LastName") = Request.Form("LastName")<BR><BR>UserRS.Close<BR><B R>&#039Response.Redirect("http://intranet")<BR>%&#062;<BR><BR>Please let me know what this means and how I can fix it. Thx.

  2. #2
    Join Date
    Dec 1969

    Default RE: Add new record to Access Database problem

    I don&#039t think you can use the .addnew, when you are passing it a SQL statment. What I would do is pass it just the table name.<BR><BR> "MPS", UserConn, 3, 2<BR><BR>UserRS.addnew<BR>UserRS("LastName") = Request.Form("LastName")<BR>UserRS.Update<BR><BR>U serRS.Close<BR><BR><BR>HTH<BR><BR>Jerry<BR><BR><BR ><BR>

Posting Permissions

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