|
 |
asp_databases thread: Stored Procedures
Message #1 by Sam Clohesy <sam@e...> on Wed, 25 Jul 2001 09:27:32 +0100
|
|
Hi Wrox guys I am trying to run an insert stored procedure from an ASP page
Here is my code:
Dim cmdAddBugs
Set cmdAddbugs = Server.Createobject ("ADODB.Command")
With cmdAddBugs
.ActiveConnection = conn
.CommandText = "sp_insert_bugs"
.CommandType = adCmdStoredProc
'##Create the parameters..
.Parameters.Append.CreateParameter ("@Project_ID_1", adVarWChar,
adParamInput, 10)
.Parameters.Append.CreateParameter ("@Bug_type_2", adVarChar, adParamInput,
10)
.Parameters.Append.CreateParameter ("@Bug_Assigned_3", adVarChar,
adParamInput, 10)
.Parameters.Append.CreateParameter ("@Date_Assigned_4", adDBTimeStamp,
adParamInput, 0)
.Parameters.Append.CreateParameter ("@Date_Completed_5", adDBTimeStamp,
adParamInput, 0)
.Parameters.Append.CreateParameter ("@Bug_status_6", adVarChar,
adParamInput, 10)
.Parameters.Append.CreateParameter ("@Bug_priority_7", adVarChar,
adParamInput, 10)
.Parameters.Append.CreateParameter("@Comments_8", adVarWChar, adParamInput,
100)
.Parameters.Append.CreateParameter("@Bug_Browser_9", adVarWChar,
adParamInput, 50)
'Set the values of the parameters:
.Parameters("@project_id_1") = request.form ("txtProject_id")
.Parameters("@Bug_type_2") =request.form ("txtBug_type")
.Parameters ("@Bug_Assigned_3") = request.form ("txtbug_Assigned)
.Parameters ("@Date_Assigned_4") = request.form ("txtDateAssigned")
.Parameters ("@Date_Completed_5") = request.form
("txtDate_Completed)
.Parameters ("@Bug_status_6") = request.form ("txtBug_status")
.Parameters ("@Bug_priority_7") = request.form ("txtbug_priority)
.Parameters ("@Comments_8") = request.form ("txtComments)
.Parameters ("@Bug_Browser_9") = request.form ("txtBug_browser")
execute, , adExecuteNorecords
End with
And here is my error message:
Microsoft VBScript compilation error '800a0414'
Cannot use parentheses when calling a Sub
/project_manage/include/add1.asp, line 25
.Parameters.Append.CreateParameter ("@Project_ID_1", adVarWChar,
adParamInput, 10)
----------------------------------------------------------------------------
------^
I am not calling a sub, just posting to the action page. I have adovbs.inc
at the top of the page so it can't be that. I have parsed the insert SQL and
it is fine.
Any suggestion?
Thanks
Sam
Sam Clohesy
Project Manager
Tel: 0208 772 3958
E: samc@e...
W: http://www.etypemedia.co.uk
Message #2 by =?iso-8859-1?q?Birgitta=20Dahl?= <birgittadahl@y...> on Wed, 25 Jul 2001 11:58:55 +0200 (CEST)
|
|
Vbscript is pretty strange when it comes to using subs
and functions, usually if a sub/method/whatever doesnt
return anything (surprise! a sub not returning...) you
either have to use "Call subSub(parameter)" if you
want to use parantheses.
My guess is that you could just remove the parantheses
and it'll work
/ Danny
--- Sam Clohesy <sam@e...> wrote: > Hi
Wrox guys I am trying to run an insert stored
> procedure from an ASP page
>
>
> Here is my code:
>
>
>
> Dim cmdAddBugs
>
> Set cmdAddbugs = Server.Createobject
> ("ADODB.Command")
>
> With cmdAddBugs
> .ActiveConnection = conn
> .CommandText = "sp_insert_bugs"
> .CommandType = adCmdStoredProc
>
>
> '##Create the parameters..
>
>
>
> .Parameters.Append.CreateParameter ("@Project_ID_1",
> adVarWChar,
> adParamInput, 10)
> .Parameters.Append.CreateParameter ("@Bug_type_2",
> adVarChar, adParamInput,
> 10)
> .Parameters.Append.CreateParameter
> ("@Bug_Assigned_3", adVarChar,
> adParamInput, 10)
> .Parameters.Append.CreateParameter
> ("@Date_Assigned_4", adDBTimeStamp,
> adParamInput, 0)
> .Parameters.Append.CreateParameter
> ("@Date_Completed_5", adDBTimeStamp,
> adParamInput, 0)
> .Parameters.Append.CreateParameter ("@Bug_status_6",
> adVarChar,
> adParamInput, 10)
> .Parameters.Append.CreateParameter
> ("@Bug_priority_7", adVarChar,
> adParamInput, 10)
> .Parameters.Append.CreateParameter("@Comments_8",
> adVarWChar, adParamInput,
> 100)
> .Parameters.Append.CreateParameter("@Bug_Browser_9",
> adVarWChar,
> adParamInput, 50)
>
>
>
>
>
> 'Set the values of the parameters:
>
>
> .Parameters("@project_id_1") = request.form
> ("txtProject_id")
> .Parameters("@Bug_type_2") =request.form
> ("txtBug_type")
> .Parameters ("@Bug_Assigned_3") = request.form
> ("txtbug_Assigned)
> .Parameters ("@Date_Assigned_4") = request.form
> ("txtDateAssigned")
> .Parameters ("@Date_Completed_5") = request.form
> ("txtDate_Completed)
> .Parameters ("@Bug_status_6") = request.form
> ("txtBug_status")
> .Parameters ("@Bug_priority_7") = request.form
> ("txtbug_priority)
> .Parameters ("@Comments_8") = request.form
> ("txtComments)
> .Parameters ("@Bug_Browser_9") = request.form
> ("txtBug_browser")
>
>
> execute, , adExecuteNorecords
>
> End with
>
>
> And here is my error message:
>
>
> Microsoft VBScript compilation error '800a0414'
> Cannot use parentheses when calling a Sub
> /project_manage/include/add1.asp, line 25
> .Parameters.Append.CreateParameter ("@Project_ID_1",
> adVarWChar,
> adParamInput, 10)
>
----------------------------------------------------------------------------
> ------^
>
> I am not calling a sub, just posting to the action
> page. I have adovbs.inc
> at the top of the page so it can't be that. I have
> parsed the insert SQL and
> it is fine.
>
> Any suggestion?
>
> Thanks
>
> Sam
>
>
>
> Sam Clohesy
> Project Manager
> Tel: 0208 772 3958
> E: samc@e...
> W: http://www.etypemedia.co.uk
Message #3 by "Ken Schaefer" <ken@a...> on Thu, 26 Jul 2001 13:26:53 +1000
|
|
I believe you need a space between .Append and .CreateParameter:
this:
.Parameters.Append .CreateParameter(...)
not:
.Parameters.Append.CreateParameter(...)
The space tells VBScript to put CmdAddBugs in front of the full stop ie:
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter(...)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Sam Clohesy" <sam@e...>
To: "ASP Databases" <asp_databases@p...>
Sent: Wednesday, July 25, 2001 6:27 PM
Subject: [asp_databases] Stored Procedures
: Hi Wrox guys I am trying to run an insert stored procedure from an ASP
page
:
:
: Here is my code:
:
:
:
: Dim cmdAddBugs
:
: Set cmdAddbugs = Server.Createobject ("ADODB.Command")
:
: With cmdAddBugs
: .ActiveConnection = conn
: .CommandText = "sp_insert_bugs"
: .CommandType = adCmdStoredProc
:
:
: '##Create the parameters..
:
:
:
: .Parameters.Append.CreateParameter ("@Project_ID_1", adVarWChar,
: adParamInput, 10)
: .Parameters.Append.CreateParameter ("@Bug_type_2", adVarChar,
adParamInput,
: 10)
: .Parameters.Append.CreateParameter ("@Bug_Assigned_3", adVarChar,
: adParamInput, 10)
: .Parameters.Append.CreateParameter ("@Date_Assigned_4", adDBTimeStamp,
: adParamInput, 0)
: .Parameters.Append.CreateParameter ("@Date_Completed_5", adDBTimeStamp,
: adParamInput, 0)
: .Parameters.Append.CreateParameter ("@Bug_status_6", adVarChar,
: adParamInput, 10)
: .Parameters.Append.CreateParameter ("@Bug_priority_7", adVarChar,
: adParamInput, 10)
: .Parameters.Append.CreateParameter("@Comments_8", adVarWChar,
adParamInput,
: 100)
: .Parameters.Append.CreateParameter("@Bug_Browser_9", adVarWChar,
: adParamInput, 50)
:
:
:
:
:
: 'Set the values of the parameters:
:
:
: .Parameters("@project_id_1") = request.form ("txtProject_id")
: .Parameters("@Bug_type_2") =request.form ("txtBug_type")
: .Parameters ("@Bug_Assigned_3") = request.form ("txtbug_Assigned)
: .Parameters ("@Date_Assigned_4") = request.form ("txtDateAssigned")
: .Parameters ("@Date_Completed_5") = request.form
: ("txtDate_Completed)
: .Parameters ("@Bug_status_6") = request.form ("txtBug_status")
: .Parameters ("@Bug_priority_7") = request.form ("txtbug_priority)
: .Parameters ("@Comments_8") = request.form ("txtComments)
: .Parameters ("@Bug_Browser_9") = request.form ("txtBug_browser")
:
:
: execute, , adExecuteNorecords
:
: End with
:
:
: And here is my error message:
:
:
: Microsoft VBScript compilation error '800a0414'
: Cannot use parentheses when calling a Sub
: /project_manage/include/add1.asp, line 25
: .Parameters.Append.CreateParameter ("@Project_ID_1", adVarWChar,
: adParamInput, 10)
: --------------------------------------------------------------------------
--
: ------^
:
: I am not calling a sub, just posting to the action page. I have adovbs.inc
: at the top of the page so it can't be that. I have parsed the insert SQL
and
: it is fine.
:
: Any suggestion?
:
: Thanks
:
: Sam
\
Message #4 by Sam Clohesy <sam@e...> on Wed, 25 Jul 2001 11:49:53 +0100
|
|
Hi!
Thanks for your suggestion, I have tried using
.Parameters.refresh
and then it throws up:
ADODB.Command error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/project_manage/include/add1.asp, line 18
(18 being the
With CmdBugs
.ActiveConnection
line )
grrr!!
Thanks again
Sam
-----Original Message-----
From: Birgitta Dahl [mailto:birgittadahl@y...]
Sent: 25 July 2001 10:59
To: ASP Databases
Subject: [asp_databases] Re: Stored Procedures
Vbscript is pretty strange when it comes to using subs
and functions, usually if a sub/method/whatever doesnt
return anything (surprise! a sub not returning...) you
either have to use "Call subSub(parameter)" if you
want to use parantheses.
My guess is that you could just remove the parantheses
and it'll work
/ Danny
Message #5 by Sam Clohesy <sam@e...> on Thu, 26 Jul 2001 09:26:35 +0100
|
|
Hi ken thanks for your suggestions, I changed the code to read:
I now only falls over at the end:
<!--#include file ="Connection.asp" -->
<!--#include file ="ADOX.asp" -->
<%
Dim cmdAddBugs
Set cmdAddbugs = Server.Createobject ("ADODB.Command")
'With cmdAddBugs
cmdAddBugs.ActiveConnection = conn
cmdAddBugs.CommandText = "sp_insert_bugs"
cmdAddBugs.CommandType = adCmdStoredProc
'##Create the parameters..
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Project_ID_1",
adVarWChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Bug_type_2",
adVarChar,adParamInput,10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Bug_Assigned_3",
adVarChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Date_Assigned_4",
adDBTimeStamp,adParamInput, 0)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
("@Date_Completed_5", adDBTimeStamp,adParamInput, 0)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Bug_status_6",
adVarChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Bug_priority_7",
adVarChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Comments_8",
adVarWChar,adParamInput,100)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Bug_Browser_9",
adVarWChar,adParamInput, 50)
'Set the values of the parameters
.Parameters("@project_id_1") = request.form ("txtProject_id")
.Parameters("@Bug_type_2") =request.form ("txtBug_type")
.Parameters ("@Bug_Assigned_3") = request.form ("txtbug_Assigned")
.Parameters ("@Date_Assigned_4") = request.form ("txtDateAssigned")
.Parameters ("@Date_Completed_5") = request.form("txtDate_Completed")
.Parameters ("@Bug_status_6") = request.form ("txtBug_status")
.Parameters ("@Bug_priority_7") = request.form ("txtbug_priority")
.Parameters ("@Comments_8") = request.form ("txtComments")
.Parameters ("@Bug_Browser_9") = request.form ("txtBug_browser")
execute, , adExecuteNorecords
End with 'Line 50
response.redirect "admin.asp?action=2"
Now the error messages is:
Microsoft VBScript compilation error '800a0400'
Expected statement
/project_manage/include/add2.asp, line 50
End with
Any assitance etc (And anything that prevents me building a lenghty insert
statement..)
(Nice site by the way)
Sam
Message #6 by "Ken Schaefer" <ken@a...> on Thu, 26 Jul 2001 22:48:38 +1000
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_00A4_01C11625.1C39B6F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I think you're out with your line count by 1 line.
I think line 50 is this line:
: execute, , adExecuteNorecords
You need to have
.execute, ,adExecuteNoRecords
(the . is missing)
When you use the With Object syntax, all you can leave out is the object
name. You need everything else (including the full stops). So:
objCommand.Execute,,adExecuteNoRecords
'---------^ (full stop here)
becomes
With objCommand
.Execute,,adExecuteNoRecords
'---^ (full stop still here)
End With
(notice the . that still remains in front of .Execute?)
(change this message to a monospaced font if required to see what I
mean)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----- Original Message -----
From: "Sam Clohesy" <sam@e...>
To: "ASP Databases" <asp_databases@p...>
Sent: Thursday, July 26, 2001 6:26 PM
Subject: [asp_databases] Re: Stored Procedures
: Hi ken thanks for your suggestions, I changed the code to read:
: I now only falls over at the end:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #7 by Sam Clohesy <sam@e...> on Thu, 26 Jul 2001 14:07:55 +0100
|
|
Hi Ken, thanks again for your spedy response.
My code now reads:
<!--#include file ="Connection.asp" -->
<!--#include file ="adovbs.inc" -->
<%
Select Case request.querystring ("action")
Case addBugs
Dim cmdAddBugs
Set cmdAddbugs = Server.Createobject ("ADODB.Command")
'With cmdAddBugs
cmdAddBugs.ActiveConnection = strconn
cmdAddBugs.CommandText = "sp_insert_bugs"
cmdAddBugs.CommandType = adCmdStoredProc
'##Create the parameters..
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Project_ID_1",
adVarWChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Bug_type_2",
adVarChar,adParamInput,10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Bug_Assigned_3",
adVarChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Date_Assigned_4",
adDBTimeStamp,adParamInput, 0)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
("@Date_Completed_5", adDBTimeStamp,adParamInput, 0)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Bug_status_6",
adVarChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter ("@Bug_priority_7",
adVarChar,adParamInput, 10)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Comments_8",
adVarWChar,adParamInput,100)
CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Bug_Browser_9",
adVarWChar,adParamInput, 50)
'Set the values of the parameters
.Parameters("@project_id_1") = request.form ("txtProject_id") 'Line 41
.Parameters("@Bug_type_2") =request.form ("txtBug_type")
.Parameters ("@Bug_Assigned_3") = request.form ("txtbug_Assigned")
.Parameters ("@Date_Assigned_4") = request.form ("txtDateAssigned")
.Parameters ("@Date_Completed_5") = request.form("txtDate_Completed")
.Parameters ("@Bug_status_6") = request.form ("txtBug_status")
.Parameters ("@Bug_priority_7") = request.form ("txtbug_priority")
.Parameters ("@Comments_8") = request.form ("txtComments")
.Parameters ("@Bug_Browser_9") = request.form ("txtBug_browser")
.execute, ,adExecuteNoRecords
'execute, , adExecuteNorecords
'End with
'response.redirect "msn.com"
End select
%>
But now it falls over on:
Microsoft VBScript runtime error '800a01f9'
Invalid or unqualified reference
/project_manage/include/add2.asp, line 41
Do I have to update the way these parameters are appended?
Thanks again..
Again any suggestion
Sam
Message #8 by "Tomm Matthis" <matthis@b...> on Thu, 26 Jul 2001 11:16:16 -0400
|
|
You forgot the period before the execute statement...
-- Tomm
> -----Original Message-----
> From: Sam Clohesy [mailto:sam@e...]
> Sent: Thursday, July 26, 2001 4:27 AM
> To: ASP Databases
> Subject: [asp_databases] Re: Stored Procedures
>
>
> Hi ken thanks for your suggestions, I changed the code to read:
> I now only falls over at the end:
>
> <!--#include file =3D"Connection.asp" -->
> <!--#include file =3D"ADOX.asp" -->
>
> <%
>
> Dim cmdAddBugs
>
> Set cmdAddbugs =3D Server.Createobject ("ADODB.Command")
>
> 'With cmdAddBugs
> cmdAddBugs.ActiveConnection =3D conn
> cmdAddBugs.CommandText =3D "sp_insert_bugs"
> cmdAddBugs.CommandType =3D adCmdStoredProc
>
>
> '##Create the parameters..
>
>
>
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Project_ID_1",
> adVarWChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Bug_type_2",
> adVarChar,adParamInput,10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Bug_Assigned_3",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Date_Assigned_4",
> adDBTimeStamp,adParamInput, 0)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Date_Completed_5", adDBTimeStamp,adParamInput, 0)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
("@Bug_status_6",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Bug_priority_7",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Comments_8",
> adVarWChar,adParamInput,100)
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Bug_Browser_9",
> adVarWChar,adParamInput, 50)
>
>
>
>
>
> 'Set the values of the parameters
>
>
> .Parameters("@project_id_1") =3D request.form ("txtProject_id")
> .Parameters("@Bug_type_2") =3Drequest.form ("txtBug_type")
> .Parameters ("@Bug_Assigned_3") =3D request.form ("txtbug_Assigned")
> .Parameters ("@Date_Assigned_4") =3D request.form ("txtDateAssigned")
> .Parameters ("@Date_Completed_5") =3D
request.form("txtDate_Completed")
> .Parameters ("@Bug_status_6") =3D request.form ("txtBug_status")
> .Parameters ("@Bug_priority_7") =3D request.form ("txtbug_priority")
> .Parameters ("@Comments_8") =3D request.form ("txtComments")
> .Parameters ("@Bug_Browser_9") =3D request.form ("txtBug_browser")
>
>
> execute, , adExecuteNorecords
> End with 'Line 50
> response.redirect "admin.asp?action=3D2"
>
> Now the error messages is:
>
> Microsoft VBScript compilation error '800a0400'
>
> Expected statement
>
> /project_manage/include/add2.asp, line 50
>
> End with
>
>
> Any assitance etc (And anything that prevents me building a lenghty
insert
> statement..)
>
> (Nice site by the way)
>
> Sam
>
Message #9 by "Tomm Matthis" <matthis@b...> on Thu, 26 Jul 2001 11:22:33 -0400
|
|
You remarked out the With cmdBugs statement but when you reference the
parameters collection, you're using the shorthand notation for the WITH
construct.
-- Tomm
> -----Original Message-----
> From: Sam Clohesy [mailto:sam@e...]
> Sent: Thursday, July 26, 2001 9:08 AM
> To: ASP Databases
> Subject: [asp_databases] Re: Stored Procedures
>
>
>
> Hi Ken, thanks again for your spedy response.
>
> My code now reads:
>
>
> <!--#include file =3D"Connection.asp" -->
> <!--#include file =3D"adovbs.inc" -->
>
>
> <%
>
> Select Case request.querystring ("action")
> Case addBugs
>
> Dim cmdAddBugs
>
> Set cmdAddbugs =3D Server.Createobject ("ADODB.Command")
>
> 'With cmdAddBugs
> cmdAddBugs.ActiveConnection =3D strconn
> cmdAddBugs.CommandText =3D "sp_insert_bugs"
> cmdAddBugs.CommandType =3D adCmdStoredProc
>
>
> '##Create the parameters..
>
>
>
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Project_ID_1",
> adVarWChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Bug_type_2",
> adVarChar,adParamInput,10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Bug_Assigned_3",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Date_Assigned_4",
> adDBTimeStamp,adParamInput, 0)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Date_Completed_5", adDBTimeStamp,adParamInput, 0)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
("@Bug_status_6",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Bug_priority_7",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter("@Comments_8",
> adVarWChar,adParamInput,100)
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Bug_Browser_9",
> adVarWChar,adParamInput, 50)
>
>
>
>
>
> 'Set the values of the parameters
>
>
> .Parameters("@project_id_1") =3D request.form ("txtProject_id") 'Line
41
> .Parameters("@Bug_type_2") =3Drequest.form ("txtBug_type")
> .Parameters ("@Bug_Assigned_3") =3D request.form ("txtbug_Assigned")
> .Parameters ("@Date_Assigned_4") =3D request.form ("txtDateAssigned")
> .Parameters ("@Date_Completed_5") =3D
request.form("txtDate_Completed")
> .Parameters ("@Bug_status_6") =3D request.form ("txtBug_status")
> .Parameters ("@Bug_priority_7") =3D request.form ("txtbug_priority")
> .Parameters ("@Comments_8") =3D request.form ("txtComments")
> .Parameters ("@Bug_Browser_9") =3D request.form ("txtBug_browser")
>
> .execute, ,adExecuteNoRecords
> 'execute, , adExecuteNorecords
> 'End with
> 'response.redirect "msn.com"
>
> End select
>
>
>
>
> %>
>
>
> But now it falls over on:
>
>
>
> Microsoft VBScript runtime error '800a01f9'
>
>
> Invalid or unqualified reference
>
>
> /project_manage/include/add2.asp, line 41
>
>
>
> Do I have to update the way these parameters are appended?
>
> Thanks again..
>
> Again any suggestion
>
>
>
> Sam
>
Message #10 by Sam Clohesy <sam@e...> on Thu, 26 Jul 2001 18:06:45 +0100
|
|
Tomm and Ken, thanks for your advice, it is (nearly) all working OK (Is
finding parameters and Stored Procs etc)
Thanks again guys
Sam
-----Original Message-----
From: Tomm Matthis [mailto:matthis@b...]
Sent: 26 July 2001 16:23
To: ASP Databases
Subject: [asp_databases] Re: Stored Procedures
You remarked out the With cmdBugs statement but when you reference the
parameters collection, you're using the shorthand notation for the WITH
construct.
-- Tomm
> -----Original Message-----
> From: Sam Clohesy [mailto:sam@e...]
> Sent: Thursday, July 26, 2001 9:08 AM
> To: ASP Databases
> Subject: [asp_databases] Re: Stored Procedures
>
>
>
> Hi Ken, thanks again for your spedy response.
>
> My code now reads:
>
>
> <!--#include file =3D"Connection.asp" -->
> <!--#include file =3D"adovbs.inc" -->
>
>
> <%
>
> Select Case request.querystring ("action")
> Case addBugs
>
> Dim cmdAddBugs
>
> Set cmdAddbugs =3D Server.Createobject ("ADODB.Command")
>
> 'With cmdAddBugs
> cmdAddBugs.ActiveConnection =3D strconn
> cmdAddBugs.CommandText =3D "sp_insert_bugs"
> cmdAddBugs.CommandType =3D adCmdStoredProc
>
>
> '##Create the parameters..
>
>
>
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Project_ID_1",
> adVarWChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Bug_type_2",
> adVarChar,adParamInput,10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Bug_Assigned_3",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Date_Assigned_4",
> adDBTimeStamp,adParamInput, 0)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Date_Completed_5", adDBTimeStamp,adParamInput, 0)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
("@Bug_status_6",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append cmdAddBugs.CreateParameter
> ("@Bug_priority_7",
> adVarChar,adParamInput, 10)
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Comments_8",
> adVarWChar,adParamInput,100)
> CmdAddBugs.Parameters.Append
cmdAddBugs.CreateParameter("@Bug_Browser_9",
> adVarWChar,adParamInput, 50)
>
>
>
>
>
> 'Set the values of the parameters
>
>
> .Parameters("@project_id_1") =3D request.form ("txtProject_id")
'Line 41
> .Parameters("@Bug_type_2") =3Drequest.form ("txtBug_type")
> .Parameters ("@Bug_Assigned_3") =3D request.form ("txtbug_Assigned")
> .Parameters ("@Date_Assigned_4") =3D request.form
("txtDateAssigned")
> .Parameters ("@Date_Completed_5") =3D
request.form("txtDate_Completed")
> .Parameters ("@Bug_status_6") =3D request.form ("txtBug_status")
> .Parameters ("@Bug_priority_7") =3D request.form ("txtbug_priority")
> .Parameters ("@Comments_8") =3D request.form ("txtComments")
> .Parameters ("@Bug_Browser_9") =3D request.form ("txtBug_browser")
>
> .execute, ,adExecuteNoRecords
> 'execute, , adExecuteNorecords
> 'End with
> 'response.redirect "msn.com"
>
> End select
>
>
>
>
> %>
>
>
> But now it falls over on:
>
>
>
> Microsoft VBScript runtime error '800a01f9'
>
>
> Invalid or unqualified reference
>
>
> /project_manage/include/add2.asp, line 41
>
>
>
> Do I have to update the way these parameters are appended?
>
> Thanks again..
>
> Again any suggestion
>
>
>
> Sam
|
|
 |