Jump to content
BigDaddyO SQLite Error 2

Recommended Posts


I just upgraded to the new yesterday and I am testing out my scripts that use SQLite since that had a change.

I can't seem to get even the simplest of scripts to work now.  I keep getting an error 2 with any Query.

I still have a standalone version of the where this script works fine.

Any idea what needs to be changed to get this to work in the new version?

I even downloaded the most recent sqlite3.dll file from the link provided in the new help file.


#include <SQLite.au3>

FileInstall(".\Includes\SQlite3.dll", @TempDir & "\SQlite3.dll", 1)
$sMaskConn = @ScriptDir & "\SQLite_Test.db"

;Connect to the SQLite Db
    _SQLite_Startup(@TempDir & "\SQlite3.dll", False, 1)
    If @error Then
        ConsoleWrite("Error " & @error & " while connecting to SQLite database" & @CRLF)
    $hMaskDB = _SQLite_Open($sMaskConn, $SQLITE_OPEN_READWRITE)
    If @error Then
        ConsoleWrite("SQLite Open Error = " & @error & ", Extended = " & @extended & @CRLF)

;Find any records with missing data
    $sSQLite = "Select MaskID, Start_Dt from MaskData where ProdID is NULL"
    Local $hQueryRet, $aRow, $sMissingID, $aMissingID[0][2]

    _SQLite_Query($hMaskDB, $sSQLite, $hQueryRet)
    If @error Then
        ConsoleWrite("Query generated error " & @error & @CRLF)

    While _SQLite_FetchData($hQueryRet, $aRow) = $SQLITE_OK
        If $sMissingID = "" Then
            $sMissingID = $aRow[0] & "|" & $aRow[1]
            $sMissingID &= @CRLF & $aRow[0] & "|" & $aRow[1]
    _ArrayAdd($aMissingID, $sMissingID, 0, "|", @CRLF)

    _ArrayDisplay($aMissingID, "Missing ID's")


Attached the simple .db that i built for this sample script.



hmm... I guess I have to have a signature...

Share this post

Link to post
Share on other sites


It is a problem in _ArrayAdd - mea culpa. It is already fixed and you can download and replace the Array library as explained here:


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

Thanks Melba, Replacing those two files fixed it.

hmm... I guess I have to have a signature...

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now