I've been trying to us SQLite 3. with PB. Using the DLL is not a problem thats working,but when I call the close function for the DB I get this error.
Here is the app code. Maybe someone knows something I don't . I've been reading the docs and searching google all day for a clue and nothing so far.library routine called out of sequence
Ideas?Clues? Help?! I need at least an inkling of the issue here any help is appreciated.;Setup constants
; This is all based on the SQLite 3.x API docs
#SQLITE_OK = 0 ; Successful result
#SQLITE_ERROR = 1 ; SQL error Or missing database
#SQLITE_INTERNAL = 2 ; An 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 sqlite_interrupt()
#SQLITE_IOERR = 10 ; Some kind of disk I/O error occurred
#SQLITE_CORRUPT = 11 ; The database disk image is malformed
#SQLITE_NOTFOUND = 12 ; (Internal Only) 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 ; Database lock protocol error
#SQLITE_EMPTY = 16 ; (Internal Only) Database table is empty
#SQLITE_SCHEMA = 17 ; The database schema changed
#SQLITE_TOOBIG = 18 ; Too much Data For one row of a table
#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_ROW = 100 ; sqlite_step() has another row ready
#SQLITE_DONE = 101 ; sqlite_step() has finished executing
; open and load the DLL
If OpenLibrary(255,"sqlite3.dll") = 0
MessageRequester("Error", "sqlite3.dll Failed To load! Aborting execution!", 0)
EndIf
ExamineLibraryFunctions(255)
Repeat
Debug LibraryFunctionName()
retl = NextLibraryFunction()
Until retl = 0
; now import a few functions
OnErrorResume()
*sqlopen = IsFunction(255, "sqlite3_open")
*sqlexec = IsFunction(255, "sqlite3_exec")
*sqlfree = IsFunction(255, "sqlite3_free")
*sqlclose = IsFunction(255, "sqlite3_close")
*sqlerror = IsFunction(255, "sqlite3_errmsg")
;Debug GetLastError_()
If *sqlopen
ret.l = CallFunctionFast(*sqlopen,"c:\code\pb\test.db",@handle)
Debug ret
Debug handle
EndIf
;Debug GetLastError_()
query.s = "CREATE TABLE (name text,lname test);"
If *sqlexec
ret.l = CallFunctionFast(*sqlexec,@handle,query$,0,0,@ret)
Debug ret
If ret <> 0
ret.l = CallFunctionFast(*sqlerror,@ret)
Debug PeekS(ret)
EndIf
;Debug ret
EndIf
;Debug GetLastError_()
;If *sqlfree
;ret.l = CallFunctionFast(*sqlfree,@handle)
;Debug ret
;If ret <> 0
;ret.l = CallFunctionFast(*sqlerror,@ret)
;Debug PeekS(ret)
;EndIf
;EndIf
If *sqlclose
ret.l = CallFunctionFast(*sqlclose,@handle)
Debug ret
If ret <> 0
ret.l = CallFunctionFast(*sqlerror,@ret)
Debug PeekS(ret)
EndIf
EndIf
;Debug GetLastError_()
CloseLibrary(255)


