我正在尝试此操作,但ADODB.Recordset error '800a0e78' Operation is not allowed when the object is closed.
使用此代码时出现错误If ScopeID.EOF Then
请不要回答使用该CreateParam
方法,寻找没有该方法的解决方案。谢谢。
<%
set Cmd = Server.CreateObject("ADODB.Command")
Cmd.ActiveConnection = conn
Cmd.CommandText = "INSERT INTO TABLE (NAME) VALUES ('test') SELECT SCOPE_IDENTITY() AS ID"
Cmd.CommandType = 1
Cmd.CommandTimeout = 0
Cmd.Prepared = true
Set ScopeID = Cmd.Execute()
If ScopeID.EOF Then
Response.Write "There was an Error in your request, Please try again"
Response.End
Else
ID= ScopeID(0).Value
End IF
ScopeID.Close
Set ScopeID = Nothing
Set Cmd = Nothing
Response.Write ID
%>