Hi
I have 2 sqlite db and im trying to read them using ahk. I did some searches and the results are a horror show. Outdated, pages that are broken, sqlite but for older ahk, just a big load of complete broken bits and pieces of unusable scripts and fragments, including what was posted by just me, usually good working scripts.
I am hopeful that at least one person here have a current working method that a ahk script can read a sqlite db.
Please share what you have that works.
SQLite and AHK Topic is solved
Re: SQLite and AHK
Hi,
I'm accessing MS-Access-Databases via ADOSQL (thanks VxE!) and it works (very) well.
I'm not sure whether it works with SQLITE but I think it is worth a try https://autohotkey.com/boards/viewtopic.php?t=74.
J.B.
I'm accessing MS-Access-Databases via ADOSQL (thanks VxE!) and it works (very) well.
I'm not sure whether it works with SQLITE but I think it is worth a try https://autohotkey.com/boards/viewtopic.php?t=74.
J.B.
AHK: 1.1.37.01 Ansi, 32-Bit; Win10 22H2 64 bit, german
Re: SQLite and AHK
thank you, it does not support sqlite.Jovannb wrote:Hi,
I'm accessing MS-Access-Databases via ADOSQL (thanks VxE!) and it works (very) well.
I'm not sure whether it works with SQLITE but I think it is worth a try https://autohotkey.com/boards/viewtopic.php?t=74.
J.B.
Re: SQLite and AHK
AFAIK it does when you install SQLite ODBC drivers: http://www.ch-werner.de/sqliteodbc/
Re: SQLite and AHK
tried that, no luck,HotKeyIt wrote:AFAIK it does when you install SQLite ODBC drivers: http://www.ch-werner.de/sqliteodbc/
Re: SQLite and AHK
SQLiteDB does not work for you? What's wrong?
Re: SQLite and AHK
Oh, the man himself! nice to see you in this threadjust me wrote:SQLiteDB does not work for you? What's wrong?
I have the dll in the scripts folder and also have my database in the folder, I even renamed my database test.db so I can work with your demo easily.
But once I ran it it updated my db (I have backups).
All I need to do is get ahk to look at my db and show me all data from a table called training and column called makeup and then I will export that to a text file (using fileappened or something).
Such a simple task but I cannot get it done, i cant get it to even show in the gui that is part of the sample script, my query is good because i tested it in bd browser for sqlite just to make sure!
thank you
Re: SQLite and AHK Topic is solved
@ Yana Petrikova
consider to login/register an account to speed things up.
Otherwise you've to wait until your postings are reviewed by an admin/moderator.
Again and again and again ...
Happy scripting
consider to login/register an account to speed things up.
Otherwise you've to wait until your postings are reviewed by an admin/moderator.
Again and again and again ...
Happy scripting
Re: SQLite and AHK
As is, the sample script is not designed to run on an existing DB file. The Test.db will be deleted and recreated on each run.
To check whether the class is working with your DB you might try the following script:
To check whether the class is working with your DB you might try the following script:
Code: Select all
#NoEnv
; #Warn
#SingleInstance force
SetWorkingDir, %A_ScriptDir%
SetBatchLines, -1
DBFileName := A_ScriptDir . "\YourFileName" ; <<< insert your DB file name
DB := New SQLiteDB
If !DB.OpenDB(DBFileName) {
MsgBox, 16, SQLite Error, % "Msg:`t" . DB.ErrorMsg . "`nCode:`t" . DB.ErrorCode
ExitApp
}
SQL := "SELECT makeup FROM training;" ; <<< check the table and column name
Result := ""
If !DB.GetTable(SQL, Result)
MsgBox, 16, SQLite Error: GetTable, % "Msg:`t" . DB.ErrorMsg . "`nCode:`t" . DB.ErrorCode
Else
{
Values := ""
For Each, Row In Result.Rows
Values .= Row[1] . "`n" ; there is only one column
Gui, Add, Text, xm, % "RowCount: " . Result.RowCount
Gui, Add, Text, xm, % "ColumnCount: " . Result.ColumnCount
Gui, Add, Edit, xm w400 r25 vED
GuiControl, , ED, %Values%
Gui, Show, , Result
}
DB.CloseDB()
Return
GuiClose:
ExitApp
#Include Class_SQLiteDB.ahk
Re: SQLite and AHK
That worked better and easier than I ever imagined. Thanks a lotjust me wrote:As is, the sample script is not designed to run on an existing DB file. The Test.db will be deleted and recreated on each run.
To check whether the class is working with your DB you might try the following script:Code: Select all
#NoEnv ; #Warn #SingleInstance force SetWorkingDir, %A_ScriptDir% SetBatchLines, -1 DBFileName := A_ScriptDir . "\YourFileName" ; <<< insert your DB file name DB := New SQLiteDB If !DB.OpenDB(DBFileName) { MsgBox, 16, SQLite Error, % "Msg:`t" . DB.ErrorMsg . "`nCode:`t" . DB.ErrorCode ExitApp } SQL := "SELECT makeup FROM training;" ; <<< check the table and column name Result := "" If !DB.GetTable(SQL, Result) MsgBox, 16, SQLite Error: GetTable, % "Msg:`t" . DB.ErrorMsg . "`nCode:`t" . DB.ErrorCode Else { Values := "" For Each, Row In Result.Rows Values .= Row[1] . "`n" ; there is only one column Gui, Add, Text, xm, % "RowCount: " . Result.RowCount Gui, Add, Text, xm, % "ColumnCount: " . Result.ColumnCount Gui, Add, Edit, xm w400 r25 vED GuiControl, , ED, %Values% Gui, Show, , Result } DB.CloseDB() Return GuiClose: ExitApp #Include Class_SQLiteDB.ahk
Who is online
Users browsing this forum: Google [Bot], JoeWinograd, Mannaia666 and 134 guests