Try MySqlExec(myHandle, "Select * from Sometable", "MyCursor") RaiseEvent(this, "DataArrival", "MyCursor") If Used("MyCursor") OR SELECT('MyCursor') Select Count(*) From MyCursor Into Array aMyCount RaiseEvent(this, "DataArrivalCount", aMyCount) IF Used("MyCursor") OR SELECT('MyCursor') RaiseEvent("this", "AnotherEvent" ) Select MyCursor && THIS FIRE THE ERROR Scan ... EndScan Endif Endif ... Catch ... EndTryThis code show the necessity of one logical contradiction: