gooseriver
IS-IT--Management
I am trying to delete a report object from the CMC using asp code. This code works if the report exists in the cmc. I need to handle this if the report does not exist:
CE10
'Retreive the name of the report from Start.html
ReportName = request.form("ReportName")
'Query for the InfoObject to delete
Set Report = iStore.Query("Select SI_ID from CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Report' and SI_Name='" & ReportName & "'")
ReportID = Report.Item(1).Properties("SI_ID")
'Delete Report from CMS
Report.Delete("#" & ReportID)
CE10
'Retreive the name of the report from Start.html
ReportName = request.form("ReportName")
'Query for the InfoObject to delete
Set Report = iStore.Query("Select SI_ID from CI_INFOOBJECTS WHERE SI_PROGID='CrystalEnterprise.Report' and SI_Name='" & ReportName & "'")
ReportID = Report.Item(1).Properties("SI_ID")
'Delete Report from CMS
Report.Delete("#" & ReportID)