GetLastSQLError()


" "

VARIANT GetLastSQLError()

Description

This function returns detailed SQL error information for the most recent error. If you call GetLastSQLError() after a function that executed successfully, then this API returns information about the last error that occurred during a prior function call. To avoid confusion, always call this GetLastSQLError() immediately after calling a function that returned an error.

Return Value

An array (variant type VT_ARRAY | VT_VARIANT) containing error information. If no errors have occurred since you created the QMF for Windows API object, or the most recent error was not an SQL error, empty (variant type VT_EMPTY) is returned. The array has the following format:


Element Type Contents
0 long (VT_I4) Code
1 string (VT_BSTR) State
2 string (VT_BSTR) ErrProc
3 string (VT_BSTR) RDBName
4 long (VT_I4) ErrD1
5 long (VT_I4) ErrD2
6 long (VT_I4) ErrD3
7 long (VT_I4) ErrD4
8 long (VT_I4) ErrD5
9 long (VT_I4) ErrD6
10 string (VT_BSTR) Warn0
11 string (VT_BSTR) Warn1
12 string (VT_BSTR) Warn2
13 string (VT_BSTR) Warn3
14 string (VT_BSTR) Warn4
15 string (VT_BSTR) Warn5
16 string (VT_BSTR) Warn6
17 string (VT_BSTR) Warn7
18 string (VT_BSTR) Warn8
19 string (VT_BSTR) Warn9
20 string (VT_BSTR) WarnA
21 string (VT_BSTR) MessageTokens

Related Tasks

GetLastErrorString()
GetLastErrorType()
GetLastSQLCode()
GetLastSQLState()