• Welcome, Guest. Please login.
 
August 26, 2019, 12:08:07 am

News:

Welcome to the SQLitening support forums!


Result codes from SQLite

Started by mikedoty, September 25, 2007, 06:27:01 pm

Previous topic - Next topic

mikedoty

http://www.sqlite.org/capi3ref.html

%SQLITE_OK         = 0    'Success
%SQLITE_ERROR      = 1   ' SQL ERROR OR missing database
%SQLITE_INTERNAL   = 2   ' NOT USED. Internal logic ERROR IN SQLite
%SQLITE_PERM       = 3   ' ACCESS permission denied
%SQLITE_ABORT      = 4   ' CALLBACK routine requested an abort
%SQLITE_BUSY       = 5   ' The database file IS locked
%SQLITE_LOCKED     = 6   ' A table IN the database IS locked
%SQLITE_NOMEM      = 7   ' A malloc() failed
%SQLITE_READONLY   = 8   ' Attempt TO WRITE a readonly database
%SQLITE_INTERRUPT  = 9   ' Operation terminated by SQLITE3_interrupt()
%SQLITE_IOERR      =10   ' Some kind OF disk I/O ERROR occurred
%SQLITE_CORRUPT    =11   ' The database disk IMAGE IS malformed
%SQLITE_NOTFOUND   =12   ' NOT USED. Table OR record NOT found
%SQLITE_FULL       =13   ' Insertion failed because database IS full
%SQLITE_CANTOPEN   =14   ' Unable TO OPEN the database file
%SQLITE_PROTOCOL   =15   ' NOT USED. Database LOCK protocol ERROR
%SQLITE_EMPTY      =16   ' Database IS EMPTY
%SQLITE_SCHEMA     =17   ' The database schema changed
%SQLITE_TOOBIG     =18   ' STRING OR BLOB exceeds SIZE limit
%SQLITE_CONSTRAINT =19   ' Abort due TO contraint violation
%SQLITE_MISMATCH   =20   ' DATA type mismatch
%SQLITE_MISUSE     =21   ' Library used incorrectly
%SQLITE_NOLFS      =22   ' Uses OS features NOT supported ON HOST
%SQLITE_AUTH       =23   ' Authorization denied
%SQLITE_FORMAT     =24   ' Auxiliary database format ERROR
%SQLITE_RANGE      =25   ' 2nd parameter TO SQLITE3_bind OUT OF range
%SQLITE_NOTADB     =26   ' File opened that IS NOT a database file
%SQLITE_ROW        =100  ' sqlite3_step() has another row ready
%SQLITE_DONE       =101  ' sqlite3_step() has finished executing

mikedoty

September 27, 2007, 10:47:47 am #1 Last Edit: October 11, 2007, 10:00:51 am by mikedoty
'SQLiteErrors.bas

DECLARE SUB InitGlobalSQLErrors
#INCLUDE "sql3client.inc"
GLOBAL gError() AS STRING
FUNCTION PBMAIN AS LONG
  InitGlobalSQLErrors
  errcode& = sql3_connect(hSession&, sConnectionString$)
  ? gError(errcode&)
END FUNCTION

SUB InitGlobalSQLErrors
  REDIM gError(0 TO 9999) AS STRING
  gError(0)  = "Success"
  gError(1)  = "SQL ERROR OR missing database
  gError(2)  = "NOT USED. Internal logic ERROR IN SQLite
  gError(3)  = "ACCESS permission denied
  gError(4)  = "CALLBACK routine requested an abort
  gError(5)  = "The database file IS locked
  gError(6)  = "A table IN the database IS locked
  gError(7)  = "A malloc() failed
  gError(8)  = "Attempt TO WRITE a readonly database
  gError(9)  = "Operation terminated by SQLITE3_interrupt()
  gError(10) = "Some kind OF disk I/O ERROR occurred
  gError(11) = "The database disk IMAGE IS malformed
  gError(12) = "NOT USED. Table OR record NOT found
  gError(13) = "Insertion failed because database IS full
  gError(14) = "Unable TO OPEN the database file
  gError(15) = "NOT USED. Database LOCK protocol ERROR
  gError(16) = "Database IS EMPTY
  gError(17) = "The database schema changed
  gError(18) = "STRING OR BLOB exceeds SIZE limit
  gError(19) = "Abort due TO contraint violation
  gError(20) = "DATA type mismatch
  gError(21) = "Library used incorrectly
  gError(22) = "Uses OS features NOT supported ON HOST
  gError(23) = "Authorization denied
  gError(24) = "Auxiliary database format ERROR
  gError(25) = "2nd parameter TO SQLITE3_bind OUT OF range
  gError(26) = "File opened that IS NOT a database file
  gError(57) = "Unable to connect" 
  gError(100)= "sqlite3_step() has another row ready
  gError(101)= "sqlite3_step() has finished executing
 
   ' Error Codes
  gError(1000) = "%ERR_ACTION           = 1000"
  gError(1010) = "%ERR_DATA             = 1010"
  gError(1020) = "%ERR_ACCESSRIGHTS     = 1020"
  gError(1030) = "%ERR_INVALIDSOCKET    = 1030"
  gError(1040) = "%ERR_BADRECORDSET     = 1040"
  gError(1050) = "%ERR_BADSESSION       = 1050"
  gError(1060) = "%ERR_NODATABASE       = 1060"
  gError(1070) = "%ERR_BADUSEMODE       = 1070"
  gError(9999) = "%ERR_DISCONNECTED     = 9999"
 
END SUB