J
Jack
Hi,
I have the following code which addes a publisher to the publishers table in
the pubs database. However, for some reason, I am getting the following error:
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'CreateParameters'
/beginaspdatabase1/ProfASP_AddPublisher.asp, line 40 The line 40 is the
first instance of the createparameter statement.
CODE:
<!-- #INCLUDE FILE="Connection1.asp" -->
<!-- #include file="adovbs.inc" -->
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
Dim cmdPublisher, returnvalue, lngrecs
set cmdPublisher = server.CreateObject("ADODB.Command")
'Dim pub_id, pub_name, pub_city, pub_state, pub_country
'pub_id = Request.Form("txtPubID")
'Response.Write pub_id & "<br>"
'pub_name = Request.Form("txtPubName")
'Response.Write pub_name & "<br>"
'pub_city = Request.Form("txtPubCity")
'Response.Write pub_city & "<br>"
'pub_state = Request.Form("txtPubState")
'Response.Write pub_state & "<br>"
'pub_country = Request.Form("txtPubCountry")
'Response.write pub_country & "<br>"
'Response.End
With cmdPublisher
.ActiveConnection = objConn
.CommandText = "proc_insertpublisher"
.CommandType = adCmdStoredProc
'Create the parameters
.Parameters.Append .CreateParameters ("returnvalue", adInteger,
adParamReturnValue)
.Parameters.Append .CreateParameters ("pub_id", adChar, adParamInput, 4)
.Parameters.Append .CreateParameters ("pub_name", adVarWChar,
adParamInput, 40)
.Parameters.Append .CreateParameters ("pub_city", adVarWChar,
adParamInput, 20)
.Parameters.Append .CreateParameters ("pub_state", adChar, adParamInput, 2)
.Parameters.Append .CreateParameters ("pub_country", adVarWChar,
adParamInput, 30)
'Now set the parameter values
.Parameters("pub_id") = Request.Form("txtPubID") 'Here it is to be noted
that the Parameter(0) is reserved for return value
.Parameters("pub_name") = Request.Form("txtPubName")
.Parameters("pub_city") = Request.Form("txtPubCity")
.Parameters("pub_state") = Request.Form("txtPubState")
.Parameters("pub_country") = Request.Form("txtPubCountry")
'Run the stored procedure
cmd.Execute lngRecs, ,adExecuteNoRecords
'Now extract the return value
lngAdded = .Parameters("returnvalue")
end with
%>
</BODY>
</HTML>
I would appreciate any insgiht to the problem. Thanks.
I have the following code which addes a publisher to the publishers table in
the pubs database. However, for some reason, I am getting the following error:
Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'CreateParameters'
/beginaspdatabase1/ProfASP_AddPublisher.asp, line 40 The line 40 is the
first instance of the createparameter statement.
CODE:
<!-- #INCLUDE FILE="Connection1.asp" -->
<!-- #include file="adovbs.inc" -->
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
Dim cmdPublisher, returnvalue, lngrecs
set cmdPublisher = server.CreateObject("ADODB.Command")
'Dim pub_id, pub_name, pub_city, pub_state, pub_country
'pub_id = Request.Form("txtPubID")
'Response.Write pub_id & "<br>"
'pub_name = Request.Form("txtPubName")
'Response.Write pub_name & "<br>"
'pub_city = Request.Form("txtPubCity")
'Response.Write pub_city & "<br>"
'pub_state = Request.Form("txtPubState")
'Response.Write pub_state & "<br>"
'pub_country = Request.Form("txtPubCountry")
'Response.write pub_country & "<br>"
'Response.End
With cmdPublisher
.ActiveConnection = objConn
.CommandText = "proc_insertpublisher"
.CommandType = adCmdStoredProc
'Create the parameters
.Parameters.Append .CreateParameters ("returnvalue", adInteger,
adParamReturnValue)
.Parameters.Append .CreateParameters ("pub_id", adChar, adParamInput, 4)
.Parameters.Append .CreateParameters ("pub_name", adVarWChar,
adParamInput, 40)
.Parameters.Append .CreateParameters ("pub_city", adVarWChar,
adParamInput, 20)
.Parameters.Append .CreateParameters ("pub_state", adChar, adParamInput, 2)
.Parameters.Append .CreateParameters ("pub_country", adVarWChar,
adParamInput, 30)
'Now set the parameter values
.Parameters("pub_id") = Request.Form("txtPubID") 'Here it is to be noted
that the Parameter(0) is reserved for return value
.Parameters("pub_name") = Request.Form("txtPubName")
.Parameters("pub_city") = Request.Form("txtPubCity")
.Parameters("pub_state") = Request.Form("txtPubState")
.Parameters("pub_country") = Request.Form("txtPubCountry")
'Run the stored procedure
cmd.Execute lngRecs, ,adExecuteNoRecords
'Now extract the return value
lngAdded = .Parameters("returnvalue")
end with
%>
</BODY>
</HTML>
I would appreciate any insgiht to the problem. Thanks.