I have a macro which runs a list of reports whose names are held in a flat file, this macro is then scheduled so it normally runs in the background.
I have error trapping built into the macro (see below) but I have recently noticed that it has been hanging. By running in the foreground I have found that one of the reports is giving a Query Server Error where detail shows:[blue]
Error number -9:
DMS-E-GENERAL, A general exception has occurred during operation 'asynchronous open'. [/blue]
My code is: [green]
on error resume next
set impRep = impApp.OpenReport(Report_File,Prompt_String)
b_error=err
if err<>0 then
Print #1, "Error: " & Err & " " & Error$
else
Print #1, "Report opened: " & Report_File
end if [/green]
where #1 is a log file and b_error a temporary variable to hold err.
I ran the macro in debug, yet while the error message appeared, err did not get set (b_err=0).
I did not not write the report in question and unless the error relates to the macro, I'm not worried about the error itself - I just want to know how to trap such an error so I can log it and loop onto the next report in the list. Any ideas please?
Thanks in advance (hopefully)
Simon Rouse
I have error trapping built into the macro (see below) but I have recently noticed that it has been hanging. By running in the foreground I have found that one of the reports is giving a Query Server Error where detail shows:[blue]
Error number -9:
DMS-E-GENERAL, A general exception has occurred during operation 'asynchronous open'. [/blue]
My code is: [green]
on error resume next
set impRep = impApp.OpenReport(Report_File,Prompt_String)
b_error=err
if err<>0 then
Print #1, "Error: " & Err & " " & Error$
else
Print #1, "Report opened: " & Report_File
end if [/green]
where #1 is a log file and b_error a temporary variable to hold err.
I ran the macro in debug, yet while the error message appeared, err did not get set (b_err=0).
I did not not write the report in question and unless the error relates to the macro, I'm not worried about the error itself - I just want to know how to trap such an error so I can log it and loop onto the next report in the list. Any ideas please?
Thanks in advance (hopefully)
Simon Rouse