Application.GetNextQueryError
Returns the next query error in the current macro.
The GetNextQueryError method returns a string that contains the number and associated text for an Impromptu query error.
When a query error is detected, it raises the error number 24610: This report cannot be converted to access the database., indicating that some type of query error has occurred. When occurs, use the GetNextQueryError method to return query error numbers along with their descriptions.
Query Errors fall into the following categories:
Error Range | Error Type |
100 to 299 | Critical errors. These can occur at either compile-time or runtime, depending on the nature of the error. |
300 to 499 | Warnings. These are ignored unless the UseQueryWarnings property is set to 1. |
500 or greater | Critical runtime errors. |
The following list describes briefly the errors returned using the GetNextQueryError method:
String
This example traps Impromptu query errors in sequence and shows a message for each one that appears.
Sub Main()
Dim objImpApp As object
Dim objImpRep As object
Dim strErr as String
On Error goto HndlErr
Set objImpApp = CreateObject("CognosImpromptu.Application")objImpApp.visible 1
objImpApp.UseQueryWarnings 1
objImpApp.OpenCatalog _
"sybase.cat","admin","admin_pwd","qcimprom","qcimprom",1
Set objImpRep = objImpApp.OpenReport("sybase01.imr")HndlErr:
do
strErr = objImpApp.GetNextQueryError
if strErr <> "" then
MsgBox strErr
else
exit do
end if
loop
resume next
Set objImpRep = Nothing
Set objImpApp = Nothing
End sub