Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 8:28 on August 25, 2006

"Object closed, permitted operation" was encountered?

I put out my source code stickers
The problem is the code
Register.asp-------------------------------------
"%@LANGUAGE=" VBSCRIPT "CODEPAGE=" 936 "dilatation
"!--#include File=conn.asp-->
"Html>
"Head are
"Title></title>
"/head>

"Body>
<%
Dim username
Dim password
Dim conform
Dim checkSql
Dim insertSql


Username=request.Form ( "username")
Password=request.Form ( "password")
CheckSql= "select * from table where username= users'" &username& " '"
InsertSql= "INSERT INTO users ([username], [password]) VALUES ( '" &username& "', '" &password& "')"

Set rs=server.CreateObject ( "adodb.recordset")
Rs.open checkSql, conn,1,1
If not rs.eof then
Response.Write ( "Sorry, the people who had registered users")
Rs.close
Else
Rs.close
Rs.open insertSql, conn,1,1
Rs.close
          
End if

Set rs=nothing
Conn.close
Set conn=nothing
     

%>
"/body>
"/html>
There will be html page document, Form Lane is a simple text box, the name of username and password

However, the implementation of virtually being given, suggesting mistakes in rs.open insertSql, conn,1,1
Rs.close

The rs.close
But I do not see any problem ah

Um rs.close removed immediately put else will be good enough.

Not, if deleted, would arise
Object opened, are not allowed to operate
The incorrect report, to be closed and then re-introduced into the new sgl rs = Sentence

Indeed, while being given, but the insertion orders have been completed, I saw the addition of a record in the database

Rs.close deleted as a final and there is no problem, but I do not know whether this sentence was executed set rs=nothing

Why should Lane IF ELSE up rs.close 呢??

Mody rs.close not only on the bottom one. . . .

Implementation of course, unless you are in front of it will not be carried out only with Response.End

Rs.open insertSql, conn,1,1
Why not use this sentence should be replaced
Conn.execute (insertSql)
This relatively high efficiency

Let you smile, said in a message

On the bottom really streamline this was an oversight and the results, or the incorrect report

Fj47 said in a message

Indeed it could solve the problem, in this case not rs =




 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com