Operation is not allowed when the object is closed

Results 1 to 2 of 2

Thread: Operation is not allowed when the object is closed

  1. #1
    Join Date
    Dec 1969

    Default Operation is not allowed when the object is closed

    I try to check if the email existe in the data base.. if yes will show up the error message if not it will show the registration form... <BR><BR><BR>"Operation is not allowed when the object is closed."<BR><BR>================================== ===========<BR>&#060;%<BR>&#039;Dimension variables<BR>Dim adoCon &#039;Holds the Database Connection Object<BR>Dim AddNewMembres &#039;Holds the recordset for the new record to be added to the database<BR>Dim strSQL &#039;Holds the SQL query for the database<BR><BR>&#039;Create an ADO connection odject<BR>Set adoCon = Server.CreateObject("ADODB.Connection")<BR>&#039;S et an active connection to the Connection object using a DSN-less connection<BR>adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../ssl_html/Membres.mdb")<BR>&#039;Create an ADO recordset object<BR>Set AddNewMembres = Server.CreateObject("ADODB.Recordset")<BR>&#039;In itialise the strSQL variable with an SQL statement to query the database<BR>strSQL = "SELECT tblMembres.* FROM tblMembres WHERE email = &#039;"& Request.Form("email") & "&#039; "<BR><BR>If AddNewMembres.EOF Then &#060;---- ERROR MESSAGE IS HERE<BR>&#039;The email wasn&#039;t found, since END OF FILE was reached. <BR>response.redirect("Inscriptions_Form.asp") <BR>Else <BR>&#039;A matching record was found, and so let him through, or whatever <BR>response.redirect("Erreur.html") <BR>End If <BR><BR>&#039;Reset server objects<BR>AddNewMembres.Close<BR>Set AddNewMembres = Nothing<BR>Set adoCon = Nothing<BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: you didn't open the recordset...

    Add this line after the SQL line.<BR><BR>AddNewMembres.open strSQL, adoCon

Posting Permissions

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