PdcApplication.LastError: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
 
Line 17: Line 17:
   set objQuery = pdc.Database.OpenQuery(pdcConData)
   set objQuery = pdc.Database.OpenQuery(pdcConData)


   objQuery.SQL = "this is not correct SQL"
   objQuery.SQL = "This is not a correct SQL statement"


   if objQuery.Execute then
   if objQuery.Execute then

Latest revision as of 10:59, 31 July 2013

Declaration

LastError as String

Description

Returns last errorstring created by PdC.

Notes

Returns the last reported PdC error. Not set for all userexits though.

Code example

This code example returns the error code of an incorrect SQL execute in PdC.

Sub sRunSQLStatement
dim objQuery

  set objQuery = pdc.Database.OpenQuery(pdcConData)

  objQuery.SQL = "This is not a correct SQL statement"

  if objQuery.Execute then

  else
    msgbox pdc.LastError
  end if

  set objQuery = nothing
End Sub

Availability

Available since January 2002.(From version 2.7)