@ghenne , I’m not being abble to make this works, already tryed sample2, it works, but not my code, even with SQLite library checked:
I don’t know if this helps:
The reference error was solved, even thus, it doesn’t enters in IF NSB.SQLITE3 check as if it does not exists, already tryed complete uninstall too and beta version.
I can’t see your code - but I find it interesting that the error message (“tableExistCheck is not defined”) happens before the “Loaded SQLite3…” message. Are you perhaps trying to use SQLite before it is done being initialized?
The safest thing to do is don’t try to execute SQLite statements at startup - wait until Main() is called.
The reference error to tableexistcheck was solved, the error still persists
Code Sequence:
Main Sub:
Sub Main()
If localStorage.lastrun <> "undefined" Then
MsgBox "this program was last run at " & localStorage.lastrun
localStorage.lastrun = localStorage.lastrun & vbCRLF & " re-opened on " & Date() & " at " & Time()
End If
End Sub
Form Main:
Dim nTables 'number of tables in the database (when it works)
Dim sqlList
Dim saves(), data
Dim books(365,9)
databaseSize=22
iRec = 0
debugger
DB = SqlOpenDatabase("localStorage")
Tip : If you’re pasting code, html or config files, surround the code with triple back ticks (```), before the first line and after the last one. It will be formatted properly. (We fixed it for you this time)
Yes, your code is as I guessed.
The code in From Main will be run on startup. The SqlOpenDatabase command will be executed before SQLite is finished loading - so it fails.
If you move it into Sub Main(), it should work.