I have a CTE statement. When I try to execute in with classic asp the parameter is not replaced correctly:
Set cmd=Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = objConnection
cmd.CommandText = " my CTE is here"
cmd.CommandType = adCmdText
'adCmdUnspecified,adCmdText,adCmdTable,adCmdStoredProc,adCmdUnknown,adCmdFile,adCmdTableDirect
Set objParam = cmd.CreateParameter(, adBigInt , adParamInput ,8,CLng(MyParameter))
cmd.Parameters.Append objParam
When I get the final statement the “?” is not replace in the statement and it gives me error.
I try with each command type but no results.
The issue was caused by foolish syntax error in the “CommandText” string.