lloydanderson
IS-IT--Management
I would appreciate any help with the following code - I am trying to pass a variable from one ASP page to another and then use that variable in a stored procedure. Some of the code follows.
Dim vHotelname
vHotelname=Request.QueryString("Hotel Name"
Dim adCmdStoredProc
adCmdStoredProc = 4
Set objCmd = Server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "pickhotel"
objCmd.Parameters.Append.cmd.CreateParameter = ("HotelName", adVarChar, adParamInput, 100, vhotelname)
objCmd.CommandType = adCmdStoredProc
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Execute objCmd
Alter Procedure pickhotel ( @HotelName varchar(100) )
/*
(
@parameter1 datatype = default value,
@parameter2 datatype OUTPUT
)
*/
As
/* set nocount on */
EXEC('SELECT [Hotels Table].[Hotel Name], Actuals.[Hotel ID], Actuals.[Date ID], Actuals.[Month ID].......
WHERE Actuals.[Hotel ID] LIKE ''%' + @HotelName + '%'' AND .... )
Thanks in advance
Dim vHotelname
vHotelname=Request.QueryString("Hotel Name"
Dim adCmdStoredProc
adCmdStoredProc = 4
Set objCmd = Server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "pickhotel"
objCmd.Parameters.Append.cmd.CreateParameter = ("HotelName", adVarChar, adParamInput, 100, vhotelname)
objCmd.CommandType = adCmdStoredProc
Set objRS = Server.CreateObject("ADODB.Recordset"
objRS.Execute objCmd
Alter Procedure pickhotel ( @HotelName varchar(100) )
/*
(
@parameter1 datatype = default value,
@parameter2 datatype OUTPUT
)
*/
As
/* set nocount on */
EXEC('SELECT [Hotels Table].[Hotel Name], Actuals.[Hotel ID], Actuals.[Date ID], Actuals.[Month ID].......
WHERE Actuals.[Hotel ID] LIKE ''%' + @HotelName + '%'' AND .... )
Thanks in advance