I have this code
I know that the db connection is open and working because on the same page if I comment out the sproc call and just use inline SQL, then it works fine. Am I missing something? I checked the permissions on the sproc and public has execute permissions, I tested the sproc from management studio and it worked fine. And all of the variables are defined and populated above, so I know it is something to do with the sproc, just not sure what...
Any ideas?
Thanks,
Willie
Code:
set Conn = server.createobject("ADODB.Connection")
Conn.open DB_CONN
SET cmd = server.CreateObject("ADODB.Command")
with cmd
.ActiveConnection = Conn
.CommandText = "plant.dbo.sp_insert_rh_housekeeping_survey"
.CommandType = adCmdStoredProc
' Input parameters
.Parameters.Append .createparameter("@Building", adVarChar, adParamInput, 50, Building)
.Parameters.Append .createparameter("@Floor", adVarChar, adParamInput, 50, Floor)
.Parameters.Append .createparameter("@YearInSchool", adVarChar, adParamInput, 50, YearInSchool)
.Parameters.Append .createparameter("@RLStatus", adVarChar, adParamInput, 50, RLStatus)
.Parameters.Append .createparameter("@SweepHallwayFloors", adVarChar, adParamInput, 50, SweepHallwayFloors)
.Parameters.Append .createparameter("@SweepStairwells", adVarChar, adParamInput, 50, SweepStairwells)
.Parameters.Append .createparameter("@VacuumLoungeCarpets", adVarChar, adParamInput, 50, VacuumLoungeCarpets)
.Parameters.Append .createparameter("@ArrangeLoungeFurniture", adVarChar, adParamInput, 50, ArrangeLoungeFurniture)
.Parameters.Append .createparameter("@IroningTypingFoors", adVarChar, adParamInput, 50, IroningTypingFoors)
.Parameters.Append .createparameter("@WallSmudges", adVarChar, adParamInput, 50, WallSmudges)
.Parameters.Append .createparameter("@WaterFountains", adVarChar, adParamInput, 50, WaterFountains)
.Parameters.Append .createparameter("@EmptyTrash", adVarChar, adParamInput, 50, EmptyTrash)
.Parameters.Append .createparameter("@ChangeBulbs", adVarChar, adParamInput, 50, ChangeBulbs)
.Parameters.Append .createparameter("@BathroomSinks", adVarChar, adParamInput, 50, BathroomSinks)
.Parameters.Append .createparameter("@CleaningToilets", adVarChar, adParamInput, 50, CleaningToilets)
.Parameters.Append .createparameter("@ShowerFloorsWalls", adVarChar, adParamInput, 50, ShowerFloorsWalls)
.Parameters.Append .createparameter("@SupplyDispenserSupplies", adVarChar, adParamInput, 50, SupplyDispenserSupplies)
.Parameters.Append .createparameter("@FriendlyHelpfulAttitude", adVarChar, adParamInput, 50, FriendlyHelpfulAttitude)
.Parameters.Append .createparameter("@DiligentWithTime", adVarChar, adParamInput, 50, DiligentWithTime)
.Parameters.Append .createparameter("@Comment", adVarChar, adParamInput, 4000, Comment)
'Execute the function
'If not returning a recordset, use the adExecuteNoRecords parameter option
Set rs=.Execute
end with
set cmd = nothing
I know that the db connection is open and working because on the same page if I comment out the sproc call and just use inline SQL, then it works fine. Am I missing something? I checked the permissions on the sproc and public has execute permissions, I tested the sproc from management studio and it worked fine. And all of the variables are defined and populated above, so I know it is something to do with the sproc, just not sure what...
Any ideas?
Thanks,
Willie