Jump to content

Error using SQLite.au3


Recommended Posts

I am getting the following error when I try to run a script that includes SQLite.au3 that came with AI 3.3.8.1.

C:\Program Files (x86)\AutoIt3\Include\SQLite.au3(2,13) : ERROR: missing separator character after keyword.
#IgnoreFunc __SQLite_Inline_Version
~~~~~~~~~~~~^
C:\test\test.au3 - 1 error(s), 0 warning(s)

and the following in the SCITE console

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\test\test.au3" /UserParams  
+>21:21:08 Starting AutoIt3Wrapper v.2.1.0.8    Environment(Language:0409  Keyboard:00000409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (1.54.22.0)  from:C:\Program Files (x86)\AutoIt3
C:\Program Files (x86)\AutoIt3\Include\SQLite.au3(2,13) : ERROR: missing separator character after keyword.
#IgnoreFunc __SQLite_Inline_Version
~~~~~~~~~~~~^
C:\test\test.au3 - 1 error(s), 0 warning(s)
!>21:21:08 AU3Check ended.rc:2

Using the following test code

Opt("MustDeclareVars", 1)
Opt("TrayAutoPause",   0)
Opt("TrayMenuMode", 0)
Opt("TrayIconHide", 0)
Global Const $MyName=StringLeft(@ScriptName, StringInStr(@ScriptName,".", 0, -1)-1)
Global Const $MyMutex=$MyName & "-326647042B70D5BD"
Global $SQLloaded = False
If _MutexExists($MyMutex) Then Exit
#include <SQLite.au3>

_ConfigInitialize()

Func _ConfigInitialize()
Local $msg, $sql
Global $dbName = @AppDataCommonDir & "\testdata\testdata.db"
If Not FileExists(@AppDataCommonDir & "\testdata") Then DirCreate(@AppDataCommonDir & "\testdata")
OnAutoItExitRegister("_ConfigDestroy")
If Not FileExists(@TempDir & "\sqlite3.dll") Then FileInstall("sqlite3.dll", @TempDir & "\sqlite3.dll")
Global $sSQliteDll = _SQLite_Startup(@TempDir & "\sqlite3.dll")
Global $sSQLiteDB = _SQLite_Open($dbName)
$SQLloaded =True
$msg  = "CREATE TABLE IF NOT EXISTS test ("
$msg &= "data1 varchar(10), "
$msg &= "data2 real, "
$msg &= "data3 integer, "
$msg &= "PRIMARY KEY (data1)"
$msg &= ");"
$sql = _SQLite_Exec($sSQLiteDB, $msg)
If @error Then MsgBox(0,@ScriptName,"error creating table: test [" & $sql & "]")
EndFunc  ;==>_ConfigInitialize
Func _ConfigDestroy()
If $SQLloaded Then
  _SQLite_Close()
  _SQLite_Shutdown()
EndIf
EndFunc  ;==>_ConfigDestroy

Func _MutexExists($sOccurenceName)
    Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError
    $sOccurenceName = StringReplace($sOccurenceName, "\", "")
    $handle = DllCall("kernel32.dll", "int", "CreateMutex", "int", 0, "long", 1, "str", $sOccurenceName)
    $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    Return $lastError[0] = $ERROR_ALREADY_EXISTS
EndFunc  ;==>_MutexExists

I saw a proposed workaround for someone with the same error message, but since I am not using guilistview, and have no other includes in my script, I am at a loss. Any suggestions?

Link to comment
Share on other sites

Try Opening

C:Program Files (x86)AutoIt3IncludeSQLite.au3

and Delete the Line

#IgnoreFunc __SQLite_Inline_Version

see if that helps

Regards

Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

That does seem to get rid of the error.

The #ignorefunc directive is kind of glossed over in the help file, so I wasn't sure the ramifications of altering that line.

Everything appears to be working for both the above script, and the full script I am working on, so all is good.

Thank you.

Link to comment
Share on other sites

The error doesn't show when using the beta.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

I'll give it a try tonight with the latest beta. I prefer that to modifying the UDF.

--Edit--

Worked fine with the latest beta. Thanks for the help.

Edited by willichan
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...