Hi all,
I always use stored procedures to retrieve, update,... data. However the list of parameters can be sometimes quite large. With the current synthax I use, I always have to make sure the paramaters I pass are in the same order as they are stated in the stored procedure. However I do not find this very handy and moreover it would give me more flexibility in adapting the stored procedure if I could easaly name the parameters and hence not need to take the order into account anymore.
The syntax I use now is:
Set objCmd = Server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "{? = call dbo.stp_PersonList_Update ('" & CStr(strFirst_Name) & "','" & _
CStr(strLast_Name) & "', '" & _
CDate(dteBirthDay) & "', '" & _
CStr(strGender) & "', '" & _
CStr(strAddress) & "', '" & _
CStr(strPostalCode) & "', '" & _
CStr(strCountry) & "', '" & _
CStr(strCity) & "', '" & _
CStr(strCompany) & "', '" & _
CStr(strCompany_Website) & "', '" & _
CStr(strCompany_Activity) & "', '" & _
CStr(strPosition) & "', '" & _
CStr(strPersonal_Website) & "', '" & _
CStr(strEmail) & "', '" & _
CStr(strTelephone) & "', '" & _
CStr(strFax) & "', '" & _
CStr(strMobile) & "', " & _
CInt(intPromotion) & ", '" & _
CStr(strPassword) & "', '" & _
CStr(strRemarks) & "', '" & _
CStr(strDiplomas) & "', " & _
CInt(intSecurityLevel) & ", " & _
CInt(ABS(cBool(binActivated))) & ", '" & _
CStr(strActivationCode) & "', " & _
CLng(lngPersonID) &"}"
objCmd.CommandType = adCmdText
objCmd(0).Direction = adParamReturnValue
objCmd.Execute
intRecordCount = objCmd(0)
I wonder there is a synthax possible like:
objCmd.CommandText = "{? = call dbo.stp_PersonList_Update (@Firstname = '" & CStr(strFirst_Name) & "', @LastName ='" & CStr(strLast_Name) & "', '" & _ ....
(This synthax doesn't work, I tried it :-()
Thanks a lot in advance for your help.
Greetz,
Dirk
I always use stored procedures to retrieve, update,... data. However the list of parameters can be sometimes quite large. With the current synthax I use, I always have to make sure the paramaters I pass are in the same order as they are stated in the stored procedure. However I do not find this very handy and moreover it would give me more flexibility in adapting the stored procedure if I could easaly name the parameters and hence not need to take the order into account anymore.
The syntax I use now is:
Set objCmd = Server.CreateObject("ADODB.Command"
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = "{? = call dbo.stp_PersonList_Update ('" & CStr(strFirst_Name) & "','" & _
CStr(strLast_Name) & "', '" & _
CDate(dteBirthDay) & "', '" & _
CStr(strGender) & "', '" & _
CStr(strAddress) & "', '" & _
CStr(strPostalCode) & "', '" & _
CStr(strCountry) & "', '" & _
CStr(strCity) & "', '" & _
CStr(strCompany) & "', '" & _
CStr(strCompany_Website) & "', '" & _
CStr(strCompany_Activity) & "', '" & _
CStr(strPosition) & "', '" & _
CStr(strPersonal_Website) & "', '" & _
CStr(strEmail) & "', '" & _
CStr(strTelephone) & "', '" & _
CStr(strFax) & "', '" & _
CStr(strMobile) & "', " & _
CInt(intPromotion) & ", '" & _
CStr(strPassword) & "', '" & _
CStr(strRemarks) & "', '" & _
CStr(strDiplomas) & "', " & _
CInt(intSecurityLevel) & ", " & _
CInt(ABS(cBool(binActivated))) & ", '" & _
CStr(strActivationCode) & "', " & _
CLng(lngPersonID) &"}"
objCmd.CommandType = adCmdText
objCmd(0).Direction = adParamReturnValue
objCmd.Execute
intRecordCount = objCmd(0)
I wonder there is a synthax possible like:
objCmd.CommandText = "{? = call dbo.stp_PersonList_Update (@Firstname = '" & CStr(strFirst_Name) & "', @LastName ='" & CStr(strLast_Name) & "', '" & _ ....
(This synthax doesn't work, I tried it :-()
Thanks a lot in advance for your help.
Greetz,
Dirk