Difference between revisions of "SQLERROR()"

From Lianjapedia
Jump to: navigation, search
Line 6: Line 6:
  
 
==See Also==
 
==See Also==
[[CREATE CONNECTION]], [[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]]
+
[[SQLCANCEL()]], [[SQLCOLUMNS()]], [[SQLCOMMIT()]], [[SQLCONNECT()]], [[SQLDISCONNECT()]], [[SQLEXEC()]], [[SQLGETPROP()]], [[SQLMORERESULTS()]], [[SQLPREPARE()]], [[SQLROLLBACK()]], [[SQLSETPROP()]], [[SQLSTRINGCONNECT()]], [[SQLTABLES()]]
  
 
==Description==
 
==Description==

Revision as of 12:47, 12 December 2012

Purpose

Function to return the error message for the last remote data connection error

Syntax

SQLERROR(<nStatementHandle>)

See Also

SQLCANCEL(), SQLCOLUMNS(), SQLCOMMIT(), SQLCONNECT(), SQLDISCONNECT(), SQLEXEC(), SQLGETPROP(), SQLMORERESULTS(), SQLPREPARE(), SQLROLLBACK(), SQLSETPROP(), SQLSTRINGCONNECT(), SQLTABLES()

Description

The SQLERROR() function is used to return the error message for the last remote data connection error.

The SQLERROR() function operates on the data source specified by <nStatementHandle>, which must be an active remote data connection handle.

Keywords Description
nStatementHandle The workarea in which the gateway data source is open.

Return values:

The SQLERROR() function returns a character string containing the descriptive message for the last error.

Example

nStatHand=SQLSTRINGCONNECT("rec@rec1:user1/pass1-/usr/recital/uas/data/southwind.tcpip",.T.)
if nStatHand < 1
    messagebox("Cannot make connection", 16, "SQL Connect Error")
else
    messagebox('Connection made', 48, 'SQL Connect Message')
    store "00010" to myVar
    SQLEXEC(nStatHand, "SELECT * FROM example WHERE account_no = ?myVar", "restab")
    if used("restab")
        browse
    else
        messagebox(SQLERROR(nStatHand),16,"SQL Error")
    endif
    SQLDISCONNECT(nStatHand)
endif

Products

Lianja, Lianja Server