debbie1212
Programmer
Can I test a SQL statement in Query Analyzer without passing in the parameters? In other words, I have the following statement in my class and I want to find out what it is passing:
Public Sub UpdateAEtProjectSchedule(sConnectString , rsAEtProjectSchedule , RC , ErrorMessage )
sSQLStmt = ""
sSQLStmt = sSQLStmt & "execute AEstoUpdateAEtProjectSchedule "
sSQLStmt = sSQLStmt & "@schdkey=" & rsAEtProjectSchedule.Fields.Item("SchdKey"
& ","
sSQLStmt = sSQLStmt & "@schdprojkey=" & rsAEtProjectSchedule.Fields.Item("SchdProjKey"
& ","
sSQLStmt = sSQLStmt & "@schdphase=" & Replace(RTrim(rsAEtProjectSchedule.Fields.Item("SchdPhase"
), "'", "''"
& ","
sSQLStmt = sSQLStmt & "@schdduration=" & rsAEtProjectSchedule.Fields.Item("SchdDuration"
& ","
sSQLStmt = sSQLStmt & "@schdstartdate=" & sDateFormat(rsAEtProjectSchedule.Fields.Item("SchdStartDate"
) & ","
sSQLStmt = sSQLStmt & "@schdenddate=" & sDateFormat(rsAEtProjectSchedule.Fields.Item("SchdEndDate"
)
I have the following code in my ASP page:
rsAEtProjectSchedule.Fields("SchdProjKey"
= sKey
For nSub = 1 to ubound(sPhase)
rsAEtProjectSchedule.Fields("SchdPhase"
= sPhase(nSub)
rsAEtProjectSchedule.Fields("SchdDuration"
= sPhaseDuration(nSub)
rsAEtProjectSchedule.Fields("SchdStartDate"
= sPhaseStart(nSub)
rsAEtProjectSchedule.Fields("SchdEndDate"
= sPhaseEnd(nSub)
objProjectSchedule.UpdateAEtProjectSchedule Session("DATA_SOURCE"
, rsAEtProjectSchedule, RC, ErrorMessage
If RC = rsReturnCodes.Fields("RC_SUCCESS"
Then
Else
sResult = "Error encountered on Schedule Update. " & ErrorMessage
tfContinue = False
Exit For
End If
Next
I get the error message "Error encountered on Schedule Update. Line 1: Incorrect syntax near ','.
I would like to test it in the Query Analyzer to see what it is passing. I tried testing it in the web page with a Response.Write which was suggested on another thread but it didn't work right. I must have put it in the wrong place.
I know the problem is with schdPhase because of all of the quotes and commas but I need to see what exactly it is passing to correct it.
Thanks,
Debbie
Public Sub UpdateAEtProjectSchedule(sConnectString , rsAEtProjectSchedule , RC , ErrorMessage )
sSQLStmt = ""
sSQLStmt = sSQLStmt & "execute AEstoUpdateAEtProjectSchedule "
sSQLStmt = sSQLStmt & "@schdkey=" & rsAEtProjectSchedule.Fields.Item("SchdKey"
sSQLStmt = sSQLStmt & "@schdprojkey=" & rsAEtProjectSchedule.Fields.Item("SchdProjKey"
sSQLStmt = sSQLStmt & "@schdphase=" & Replace(RTrim(rsAEtProjectSchedule.Fields.Item("SchdPhase"
sSQLStmt = sSQLStmt & "@schdduration=" & rsAEtProjectSchedule.Fields.Item("SchdDuration"
sSQLStmt = sSQLStmt & "@schdstartdate=" & sDateFormat(rsAEtProjectSchedule.Fields.Item("SchdStartDate"
sSQLStmt = sSQLStmt & "@schdenddate=" & sDateFormat(rsAEtProjectSchedule.Fields.Item("SchdEndDate"
I have the following code in my ASP page:
rsAEtProjectSchedule.Fields("SchdProjKey"
For nSub = 1 to ubound(sPhase)
rsAEtProjectSchedule.Fields("SchdPhase"
rsAEtProjectSchedule.Fields("SchdDuration"
rsAEtProjectSchedule.Fields("SchdStartDate"
rsAEtProjectSchedule.Fields("SchdEndDate"
objProjectSchedule.UpdateAEtProjectSchedule Session("DATA_SOURCE"
If RC = rsReturnCodes.Fields("RC_SUCCESS"
Else
sResult = "Error encountered on Schedule Update. " & ErrorMessage
tfContinue = False
Exit For
End If
Next
I get the error message "Error encountered on Schedule Update. Line 1: Incorrect syntax near ','.
I would like to test it in the Query Analyzer to see what it is passing. I tried testing it in the web page with a Response.Write which was suggested on another thread but it didn't work right. I must have put it in the wrong place.
I know the problem is with schdPhase because of all of the quotes and commas but I need to see what exactly it is passing to correct it.
Thanks,
Debbie