Jump to content
Jfish

_SQLite_SQLiteExe Sqlite3.exe file not found

Recommended Posts

Hello all.  Another weekend - another episode of getting stuck on something I should be able to figure out :ranting:

I am trying to use Sqlite for a bulk import but for some reason I keep getting the error that it cannot locate the Sqlite3.exe file.  I read the help file suggesting it gets stored in the @temp directory.  When I read those files I see "sqlite3_300800403.exe" listed amongst them but I don't see "sqlite3.exe" .  This may be a dumb question but how can I point _SQLite_SQLiteExe to the sqlite3.exe and should it really be "sqlite3_300800403.exe"?

These are my includes:

#include <SQLite.au3>
#include <SQLite.dll.au3>

This is the generic version of what I am running for the import:

_SQLite_SQLiteExe($sDatabaseFilePath, ".separator ," & @CRLF & ".import '" & FileGetShortName($hImportFilePath) & "' TableName" & @CRLF, $sOutputFile)

Any guidance?

Share this post


Link to post
Share on other sites

Rename it to the correct name. For some reason this gets the version appended.


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)

Share this post


Link to post
Share on other sites

@jchd -

I did that and it worked (thank you) - but I noticed the next time that it ran it also create a copy called "sqlite3_300800403.exe".  Seems this could be a recurring problem as I believe (please correct me) that the files in the temp directory get periodically deleted?  If that is a static name for the sqlite3.exe file should the SQLite.au3 file be updated with the new name of the exe?  Alternatively, is that file getting created from  the dll?  If so, does that need to be updated?  Just curious as to root cause?

JFish

Edited by Jfish

Share this post


Link to post
Share on other sites

I advise you to copy the exe to a solid directory (e.g. @SCRIPTDIR or some folder in the path environment variable) and do the same with the SQLite3.dll file. Then comment out the SQLite.dll.au3 include line.

Clearly SQLite.dll.au3 shouldn't continuously fetch the CLI from the AutoIt repository.

Edited by jchd

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)

Share this post


Link to post
Share on other sites

 

I have the same trouble.

 

I copy the  exe from @tempdir to @scriptdir  and rename to 'sqlite3.exe'  but result is  also  ERROR: Sqlite3.exe file not found

Share this post


Link to post
Share on other sites

Are you sure no sqlite3.exe file exists in @scriptdir?

Show the code you're using.


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)

Share this post


Link to post
Share on other sites

@jchd I just copy the example script from AUTOIT3 HELP about _SQLite_SQLiteExe to test

I only change cod from ' _SQLite_SQLiteExe($sDbFile, $sIn, $sOut,-1,True)' to ' _SQLite_SQLiteExe($sDbFile, $sIn, $sOut,"C:Sqlitesqlite3.exe",True) '

beause sqlite3 install in c:sqlite

F5 ,ERROR: Sqlite3.exe file not found

then

I copy the file" sqlite3.exe" to @scriptdir , F5 ,also ERROR: Sqlite3.exe file not found

then

I copy the files"sqlite3.def" and"sqlite3.dll" to @scriptdir ,F5, also ERROR: Sqlite3.exe file not found

system: win7 64bit autoit:3.3.12.0 sqlite3:3.8.8.3


#include <File.au3>
#include <SQLite.au3>
#include <SQLite.dll.au3>
#include <StringConstants.au3>

; Filenames
Local $sTsvFile = FileGetShortName(_TempFile(@ScriptDir, "~", ".tsv"))
Local $sDbFile = FileGetShortName(_TempFile(@ScriptDir, "~", ".db"))

; Create Tsv File
FileWriteLine($sTsvFile, "a" & @TAB & "b" & @TAB & "c")
FileWriteLine($sTsvFile, "a1" & @TAB & "b1" & @TAB & "c1")
FileWriteLine($sTsvFile, "a2" & @TAB & "b2" & @TAB & "c2")

; import (using SQLite3.exe)
Local $sIn, $sOut, $i, $sCreate = "CREATE TABLE TblImport (";
For $i = 1 To _StringCountOccurance(FileReadLine($sTsvFile, 1), @TAB) + 1
    $sCreate &= "Column_" & $i & ","
Next
$sCreate = StringTrimRight($sCreate, 1) & ");"
$sIn = $sCreate & @CRLF ; Create Table
$sIn &= ".separator \t" & @CRLF ; Select @TAB as Separator
$sIn &= ".import '" & $sTsvFile & "' TblImport" & @CRLF
_SQLite_SQLiteExe($sDbFile, $sIn, $sOut,"C:\Sqlite\sqlite3.exe",True)

If @error = 0 Then
    ;Show Table (using SQLite3.dll)
    Local $iRows, $iColumns, $aRes
    _SQLite_Startup()
    ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)
    _SQLite_Open($sDbFile)
    _SQLite_GetTable2d(-1, "SELECT ROWID,* FROM TblImport;", $aRes, $iRows, $iColumns)
    _SQLite_Display2DResult($aRes) ; Output to Console
    _SQLite_Close()
    _SQLite_Shutdown()
Else
    If @error = 2 Then
        ConsoleWrite("ERROR: Sqlite3.exe file not found" & @CRLF)
    Else
        ConsoleWrite("ERROR: @error=" & @error & " when calling _SQLite_SQLiteExe" & @CRLF)
    EndIf
EndIf

; Remove Temp Files
FileDelete($sTsvFile)
FileDelete($sDbFile)

; Output:
; rowid  Column_1  Column_2  Column_3
; 1      a         b         c
; 2      a1        b1        c1
; 3      a2        b2        c2

Func _StringCountOccurance($sSearchString, $sSubString, $iCaseSense = $STR_NOCASESENSE) ; Returns Number of $sSubString in $sSearchString
    Local $iOccCnt = 1
    Do
        If StringInStr($sSearchString, $sSubString, $iCaseSense, $iOccCnt) > 0 Then
            $iOccCnt += 1
        Else
            ExitLoop
        EndIf
    Until 0
    Return $iOccCnt - 1
EndFunc   ;==>_StringCountOccurance

 

post-90484-0-84749300-1427175032_thumb.p

post-90484-0-38152800-1427175339_thumb.p

Share this post


Link to post
Share on other sites

Works out of the box for me with the latest release as x86:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3" /UserParams    
+>10:39:49 Starting AutoIt3Wrapper v.14.727.1229.0 SciTE v.3.5.0.0   Keyboard:0000040C  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:040C)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\jc\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\jc\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3
+>10:39:49 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_SQLite_LibVersion=3.8.5
 rowid  Column_1  Column_2  Column_3 
 1      a         b         c        
 2      a1        b1        c1       
 3      a2        b2        c2       
+>10:39:49 AutoIt3.exe ended.rc:0
+>10:39:49 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.6997

and latest release as x64:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3" /UserParams    
+>10:43:49 Starting AutoIt3Wrapper v.14.727.1229.0 SciTE v.3.5.0.0   Keyboard:0000040C  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:040C)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\jc\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\jc\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3
+>10:43:49 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_SQLite_LibVersion=3.8.4.3
 rowid  Column_1  Column_2  Column_3 
 1      a         b         c        
 2      a1        b1        c1       
 3      a2        b2        c2       
+>10:43:56 AutoIt3.exe ended.rc:0
+>10:43:56 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 7.499

as well as with latest beta as x86:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3" /UserParams    
+>10:42:14 Starting AutoIt3Wrapper v.14.727.1229.0 SciTE v.3.5.0.0   Keyboard:0000040C  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:040C)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\jc\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\jc\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.12.0)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3
+>10:42:14 AU3Check ended.rc:0
>Running:(3.3.12.0):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_SQLite_LibVersion=3.8.5
 rowid  Column_1  Column_2  Column_3 
 1      a         b         c        
 2      a1        b1        c1       
 3      a2        b2        c2       
+>10:42:14 AutoIt3.exe ended.rc:0
+>10:42:14 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.6961

and latest beta as x64:

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /beta /ErrorStdOut /in "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3" /UserParams    
+>10:47:13 Starting AutoIt3Wrapper v.14.727.1229.0 SciTE v.3.5.0.0   Keyboard:0000040C  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:040C)
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\jc\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\jc\AppData\Local\AutoIt v3\SciTE
>Running AU3Check (3.3.13.20)  from:C:\Program Files (x86)\AutoIt3\Beta  input:C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3
+>10:47:13 AU3Check ended.rc:0
>Running:(3.3.13.20):C:\Program Files (x86)\AutoIt3\Beta\autoit3_x64.exe "C:\Users\jc\Documents\AutoMAT\tmp\sqlite_exec.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
_SQLite_LibVersion=3.8.8.1
 rowid  Column_1  Column_2  Column_3
 1      a         b         c        
 2      a1        b1        c1       
 3      a2        b2        c2       
+>10:47:16 AutoIt3.exe ended.rc:0
+>10:47:16 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 3.125

Which AutoIt version do you use?

Note varying versions of sqlite3.exe :


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)

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

  • Similar Content

    • By Skysnake
      Hi
      I am trying to set Accelerator keys from an array.
      I select the KEY and CONTROL from a SQLite table, the Array looks like that generated for the Helpfile, but I can't get the CONTROLS to resolve...
      I though about Assign & Eval, but not sure if that's a step in the right direction. IsDeclared shows that the $var exists in Local Scope -1.  
       
      Local $Main = GUICreate("Custom MsgBox", 225, 80) GUICtrlCreateLabel("Please select a button.", 10, 10) Local $idButton_Yes = GUICtrlCreateButton("Yes", 10, 50, 65, 25) Local $idButton_No = GUICtrlCreateButton("No", 80, 50, 65, 25) Local $idButton_Exit = GUICtrlCreateButton("Exit", 150, 50, 65, 25) Local $query, $aResult, $iRows, $iColumns $query = "" ;reset $query = "Select hotkey_key, hotkey_ctrl from mytable where mykeys = 'hotkey' ; " ; ; Query $iRval = _SQLite_GetTable2d($sqliteDb, $query, $aResult, $iRows, $iColumns) If $iRval = $SQLITE_OK Then Local $sizeofHotkeys = UBound($aResult) - 1 ConsoleWrite("$sizeofHotkeys " & $sizeofHotkeys & @CRLF) If $sizeofHotkeys > 0 Then Local $main__aAccelKeys[$sizeofHotkeys][2] For $i = 0 To $sizeofHotkeys - 1 $j = $i + 1 ; replace friendly text with code -- ! alt + Shift ^ Ctrl # Windows $aResult[$j][0] = StringReplace($aResult[$j][0], "Alt", "!") $aResult[$j][0] = StringReplace($aResult[$j][0], "Shift", "+") $aResult[$j][0] = StringReplace($aResult[$j][0], "Ctrl", "^") $main__aAccelKeys[$i][0] = $aResult[$j][0] ;--- $main__aAccelKeys[$i][1] = $aResult[$j][1] ;--- Next ;~ Row|Col 0|Col 1 ;~ Row 0|F2|$idButton_Yes ;~ Row 1|F3|$idButton_No _DebugArrayDisplay($main__aAccelKeys) Local $rv = GUISetAccelerators($main__aAccelKeys, $Main) GUISetState(@SW_SHOW) ; Display the GUI.  
      Please note that this is a modified Helpfile example.
      The Helpfile specifies (a) WinHandle and (b) last Gui created.
      --> the example uses a control not a WinHandle and (b) what happens with ChildGuis? Also, the HelpFile specifies lower case, yet the examples show "{F1}" upper case?
      Also, is there a way to check the result of the GuiSetAccelerator function? 
      Note, if I add these to lines after the FOR loop, then the F1 works, and the DebugArrayDisplays shows control 4... not it's name... So I am in the right place, but my $vars names do not convert to their control numbers in the GUI
      Next $main__aAccelKeys[$sizeofHotkeys - 1][0] = "{F1}" ; -- -- use the extra row for the F1 $main__aAccelKeys[$sizeofHotkeys - 1][1] = $ChmHLP ;--- Skysnake
    • By Skeletor
      Hi All,
      Here's a really simple question. 
      I ran the code from the helpfile under: _SQLite_Open

      Issue is I end up with an error message: SQLite3.dll Can't be Loaded!
      I placed the *.dll in the include folder, but still nothing. 

      Where must this file be placed.
       
    • By Eminence
      Hello,
      Using SQLite, I was trying to select a specific column with having duplicate entries removed by using the DISTINCT function. 
      Local $sQuery = "SELECT DISTINCT supervisor, COUNT(DISTINCT employee_name) FROM data_db What the above snippet does is just list only one supervisor but with the total count of unique employee names in the whole database when it should be listing out all supervisor entries from the database and list the total count of employees per each supervisors. If I remove the COUNT function, it does list out all unique entries of supervisor names from the list. Attached is a screenshot of an example database as well. 
      Any help will be much appreciated. Thank you!

    • By Seminko
      Hey,
      I have a script that uses SQLite. It worked without a hiccup on my W7 system.
      However, last week I bought a new machine, installed W10 and autoit, and now I'm getting an error during _SQLite_Startup.
      Can anyone advise on how to find what's wrong? Tried checking $__g_hPrintCallback_SQLite but that returns nothing.
       
      Tried downloading the latest version of the dll from the link in the function page and I also replaced the default SQLite.dll.au3 that came with AutoIt with the one that came with the latest SQLite version zip.
       
      Relevant parts of my script:
      #include <SQLite.au3> #include <SQLite.dll.au3> _SQLite_Startup(@ScriptDir & "\Config\sqlite3_x64.dll", False, 1) If @error Then MsgBox(16, "SQLite Error", "SQLite3.dll Can't be Loaded! - " & $__g_hPrintCallback_SQLite & @CRLF & @CRLF & "Exiting application / Zavolej Honzovi") Exit -1 EndIf  
      Thanks
      S.
    • By FrancescoDiMuro
      Good evening everyone
      I am building a management for the company I work with, and I just imported a real amount of rows ( about 29000 ), in my SQLite DB.
      The thing I am not understanding, is the time that the script takes to build this amount of rows in the ListView.
      I didn't measure it, but I think it took 2 minutes or so to create each ListView item...
      It is normal that it takes so much time?
      What can I do to improve the creation of the items?

      Here's the code I am using to query and to create ListView items...
      ; Articles ListView: Global $lvwArticles = GUICtrlCreateListView("ID|Fornitore|Codice|Descrizione|EU|Prezzo|Sconto Applicato|Note", 14, 87, 1507, 660, BitOR($GUI_SS_DEFAULT_LISTVIEW,$LVS_SORTASCENDING,$LVS_SORTDESCENDING), BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT)) ; Query $strQuery = "SELECT * FROM ARTICOLI;" ; Query Execution _SQLite_GetTable2d($objDatabase, $strQuery, $arrResult, $intRows, $intColumns) If @error Then ; Error Handling Else ; Cleaning the ListView _GUICtrlListView_DeleteAllItems($lvwArticles) If @error Then ; Error Handling Else ; No records in the Table If UBound($arrResult) < 2 Then ; Error Handling Else _GUICtrlListView_BeginUpdate($lvwArticles) For $intCounter = 1 To UBound($arrResult) - 1 $strListViewItem = $arrResult[$intCounter][0] & "|" & _ $arrResult[$intCounter][1] & "|" & _ $arrResult[$intCounter][2] & "|" & _ $arrResult[$intCounter][3] & "|" & _ $arrResult[$intCounter][4] & "|" & _ $arrResult[$intCounter][5] & "|" & _ $arrResult[$intCounter][6] & "|" & _ $arrResult[$intCounter][7] $objListViewItem = GUICtrlCreateListViewItem($strListViewItem, $lvwArticles) Next _GUICtrlListView_EndUpdate($lvwArticles) EndIf EndIf EndIf Thanks in advance


      Best Regards.
×
×
  • Create New...