Cannot send data from ASP page to access 97 table

Results 1 to 2 of 2

Thread: Cannot send data from ASP page to access 97 table

  1. #1
    Join Date
    Dec 1969

    Default Cannot send data from ASP page to access 97 table

    I Have win95, PWS, Access97<BR><BR>I&#039m trying to send data from fields in the ASP page to the table in database. Have created a system dsn for the database. The error msg I keep getting is <BR><BR>"ADODB.Recordset error &#039 800a0e7d&#039 <BR>The application requested an operation on an object with a reference to a closed or invalid Connection object."<BR><BR>my ASP code is as follows:<BR> dim conn, strSQL, rst<BR> set conn = CreateObject("ADODB.Connection")<BR> conn.ConnectionString = "dsn=auction"<BR> set rst = Server.CreateObject("ADODB.Recordset")<BR><BR> user_username = request.form("user_username")<BR> user_password = request.form("user_password")<BR><BR> if ErrorMsg = "" then<BR> strSQL = "SELECT * FROM tblauctionusers;"<BR> rst.Open strSQL, conn, 3, 3<BR><BR> &#039Now write the data.<BR> rst.AddNew<BR> rst("user_username") = user_username<BR> rst("user_password") = user_password<BR> rst.Update<BR><BR> rst.Close<BR> conn.Close<BR> set rst= nothing<BR> set conn = nothing<BR><BR> ErrorMsg = "Your submission was successful, thanks for registering!"<BR> end if<BR><BR>Can someone please help as I have checked the dsn (numerous times). Thanks

  2. #2 Guest

    Default You did not open the connection!!!!

    After the line:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conn.Co nnectionString = "dsn=auction"<BR><BR>you need to add the line:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Conn.Op en<BR><BR>But you could have just combined them into one line:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Conn.Op en "dsn=auction"

Posting Permissions

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