Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

BASE Macro SQL error when record not found

I am attempting to write a macro that uses SQL to query a table and need to determine if there is a "Not found" result. I copied the routine at but am getting a run time error.

oContext=CreateUnoService("")   'One service for all SQL processes
oDB1=oContext.getByName("DogDBTest1")   'get the database
oConnection1=oDB1.getConnection("","")      'establish connection to database
oConnection1.ResultSetType =   'added to allow for NRF

oResult1 = oStatement1.executeQuery(sReadReg & sRegistryID)

CursorTest = oResult1.first
If CursorTest = "False" Then
    MsgBox (sRegistryID & " Not Found"
       MsgBox (oResult1.getString(1) & "=String(1) " & oResult1.getString(2) & "=String(2) " _
       & oResult1.getString(5) & "=String(5)"

yada....... Run time error says "Property or Method not found: ResultSetType

Can anyone see errors in code or point me to alternate solution to determine if no record was found I also attempted to use ifNull solution but that didn't work either