AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Building a sqlite #include and library - Edited
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  

Would you like to see SQL support for AHK?
Yes I need SQL support!
64%
 64%  [ 25 ]
SQL support would be nice.
20%
 20%  [ 8 ]
Not a requirement for me.
7%
 7%  [ 3 ]
What the hell is SQL?
7%
 7%  [ 3 ]
Total Votes : 39

Author Message
valenfor



Joined: 26 Feb 2005
Posts: 20

PostPosted: Sun Feb 26, 2006 4:50 pm    Post subject: Building a sqlite #include and library - Edited Reply with quote

Good day everyone!

As you can see from my original message below, I started this thread looking for some help with DLLCALL in order to generate a simple include. This include could be used by all with sqlite3.dll in order to provide easy database access for AHK. Now I have seen in other threads where SQL has been requested or put on the Wish List ( http://www.autohotkey.com/forum/viewtopic.php?t=7355 ). I am polling to see how much interest there is.

As it turns out due to call back function requirements it will take more then a few dllcall's to make this work. I am concidering putting in the effor to generate a solution for the ahk community, however I want to know how many people would actually use it. Depending upon the response I will press forward, otherwise I will probably look at another avenue for resolving my own needs.

Thanks for your thoughts and for voting!

Kevin


------------------ original message ------------------------

So first my kudo's once again to AHK, I have been using it for over a year now. The one piece I have missed is a sql data source. I searched through the forums this weekend and saw a few notes about Sqlite but nothing that provided a concrete example of use inside a ahk script. So that has lead me on a mission.

I know how to use sqlite3.exe in a command line instance and I thought of several ways to hack it together however I think the most useful set of options would be by implementing the DLL functions. Now I have started working on a interface to the dll and am playing with dllcall. I understand the basics with dllcall however when looking at the C calls and trying to compare the pointer arithmetic I figured I would ask for help here first.

int sqlite3_open(const char*, sqlite3**);

From a C interface a char pointer usually points to more then just one character. And the sqlite3** return is of course the db handle. I understand that to a point in ahk we have to manage the conversion (from wrapping our minds around how it will be used) ourself. So of course since ahk doesn't have a pointer value per se (I understand we have variable references) its going to look as a integer number.

So now to my question - is this why I see most people are making wrapping dll's? I can do the same but still being a little new to ahk, I wanted to save some headache by checking the path I am looking at walking down before I do and find a dead end. Are most providing wrapper dll's for variable conversions or to fill the gap in interfaces? Can anyone provide some ideas on how to approach this? Should I use a dll spy type utility to extract the interfaces instead of the C interface documentation?

Thanks in advance, looking forward to providing a library we can all use.

Kevin


Last edited by valenfor on Mon Feb 27, 2006 1:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Mon Feb 27, 2006 10:22 am    Post subject: Reply with quote

I am not too sure how to answer most of your questions...
I suppose you took a look at some DllCalls.
Sometime, when they are simple and / or called once, they are called as is.
Otherwise, we often write simple wrappers to simplify calls:
Code:
SelectObject( p_dc, p_bitmap )
{
   DllCall( "gdi32.dll\SelectObject", "uint", p_dc, "uint", p_bitmap )
}

or, as you guessed, to convert native C values or structures to AHK format. Or to chain several consistent DllCalls (open, do stuff, close).

C pointers in Win32 are 32bit integers that fit well in AHK's integer value.
Strings can be passed as is.
Structures are allocated with SetVarCapacity and passed ByRef (to handle internal zeroes).

I hope this answer most of your questions.

Oh, and you don't need a DLL spy if there is a public interface: you should use it instead, it is more reliable (if doc. is up to date).
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
valenfor



Joined: 26 Feb 2005
Posts: 20

PostPosted: Mon Feb 27, 2006 12:49 pm    Post subject: Callbacks Reply with quote

PhiLho,

Yes that was helpful, thank you. It both confirmed some items that I thought were true as well as the example gave me more ideas. Now I have my first dllcall's to both open and close the database as well as saving off the database handle. Now comes the next question --- callback functions.

---- edited
I found my answer to the callback which is possibly having to find another way or wrap this dll in order to get SQL Queries executed. The problem is that the sqlite3.dll uses a callback to return rows etc right now.

Callbacks are not possible at this time as was answered...
http://www.autohotkey.com/forum/viewtopic.php?t=4441

-------

Thanks again, if I can cover the callback for returning large query data then I think I will be able to lick this dll and get a nice include for use here.

Kevin
Back to top
View user's profile Send private message
valenfor



Joined: 26 Feb 2005
Posts: 20

PostPosted: Thu Mar 23, 2006 1:44 pm    Post subject: Reply with quote

I just wanted to say thanks to another forum member I have a hint as to how I can handle call back functions. Unfortunately I won't be able to do much with this for several more weeks as I am moving for a new job. However I will keep in touch as I make progress. Thanks to everyone who has sent in links and comments.

I was asked how to handle opening and closing the db, so I just wanted to post that piece here for now.

Code:

p_dbHandle =
g_dbResult =
g_dbResultText =

; sqlite3 database open
;-------------------------------------------------------------------------
dbOpen(database)
{
   g_dbResult := DllCall( "sqlite3.dll\sqlite3_open", "str", database, "UInt *",  p_dbHandle )      
   
   return g_dbResult
}

dbClose()
{
   g_dbResult := DllCall( "sqlite3.dll\sqlite3_close", "UInt", p_dbHandle )      
   
   return g_dbResult
}


In my notation p_ is for pointer and g_ is for a global. Of course everyone has a bit of their own style so cut and hack as you see fit.
Back to top
View user's profile Send private message
AHKnow*
Guest





PostPosted: Fri Mar 24, 2006 2:42 am    Post subject: Reply with quote

Yes and Yes!!

AutoHotkey and SQLite would be awesome.
Back to top
servezvous



Joined: 05 May 2006
Posts: 4

PostPosted: Fri May 05, 2006 8:20 pm    Post subject: SQLite + Autokey = Saving 5 hours a week!!! Reply with quote

Hi,

I was wondering if any progress was made in regards to an DLL interface to SQLite.

If this could be supported, AutoHotKey could replace VB for my needs and that would be a huge time saver!

I'am dying to see that, so if anyone as news, please let me know!
Back to top
View user's profile Send private message
valenfor



Joined: 26 Feb 2005
Posts: 20

PostPosted: Fri May 05, 2006 11:03 pm    Post subject: Reply with quote

It is not forgotten, however I have moved out of the country and though my job is great (not something that requires 60 hours a week) I have been filling in my off time with relocation tasks. However seeing that the interest is more then there, I will see what I can do to get this back on the burner now.

So I have been fighting with MS C++ and the Sqlite3 DLL and not making too much progress. I have been wanting to get better at my C++ but then it comes down to needing to complete tasks. Which is really the reason I love AutoHotKey to begin with; it lets me get things done.

So I have decided to expand on my basic skills and am seeing what kind of magic I can work with BCX. I have a large data management project and I have been using Sqlite3 to manage the data. So I am going to try to make a DLL Wrapper that will allow us to use Sqlite with AHK easily.

Keep your fingers crossed...

Val
Back to top
View user's profile Send private message
servezvous



Joined: 05 May 2006
Posts: 4

PostPosted: Tue May 23, 2006 8:50 pm    Post subject: Waiting for good news! Reply with quote

I inquiered with a programmer at work and he might take time to create the basic interface for SQL Server. Not that I prefer this one, but that is what we use I guess.

Anyway, I'll let you know if I can get anything.
Back to top
View user's profile Send private message
twhyman



Joined: 07 Dec 2005
Posts: 264

PostPosted: Thu Jul 13, 2006 4:07 pm    Post subject: Reply with quote

any progress on the sql?
Back to top
View user's profile Send private message
valenfor



Joined: 26 Feb 2005
Posts: 20

PostPosted: Thu Sep 07, 2006 4:04 pm    Post subject: Progress Reply with quote

I had created the source to export the basic connect and disconnect functionality, however every DLL I made has not been able to use the DLLCALL in order to invoke various methods - I still don't know why. Once I can figure this out and get the basic functions working, the rest should be pretty straight forward. If I get something through - you will see it here first.

V
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Thu Sep 07, 2006 4:13 pm    Post subject: Reply with quote

Look at the ErrorLevel.
It can be a problem of calling convention, stdcall vs. cdecl or such.
See DllCall page for more info.
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3652
Location: Belgrade

PostPosted: Thu Sep 07, 2006 6:24 pm    Post subject: Reply with quote

Hi there.

I didn't look intensly to see about yuor problems but I read first part of the message.

I think it is great you are doing this. As long as AHK has such comunity responsible users, it will stay at the top of automatition environments.


I will try to check out later to see if I can help. I do with sql every day, so if you have any questions or need help don't hesistate to ask.
Keep up the good work.

EDIT:

I create wrappers to dlls to avoid inpractical DllCall function, and to create interface in the spirit of AHK. Even the smallest error in DllCall will lead to bad results.
While doing wrapper to Tree View functions lately and data injection I spend many hours debuging around, several days...
SQL wrapper would be great, but it may be hard to implement (I hope not impossible).

I think that greatest addon to AHK would be ability to use function pointers. This would allow modular function patching and it will allow usage of API and DLL functions that use callbacks.
_________________
Back to top
View user's profile Send private message MSN Messenger
Guest






PostPosted: Tue Sep 12, 2006 2:34 pm    Post subject: Reply with quote

Hello,

as someone may know, there is a SQLite.au3 (AutoIt3) script, supporting direct use of SQLite3.DLL and SQLite3.exe.

So I tried to translate it. Had to read a lot, think a lot and try a lot to understand the DLLCalls. But now there is a first result:

Code:

/*
;===============================================================================
; Include Version:   0.05  (2006/09/12)
;===============================================================================
;
; AHK Version:   1.0.44.08
; Language:      English
; Description:   Functions that assist access to an SQLite database.
;
;===============================================================================
; This software is provided 'as-is', without any express or
; implied warranty.  In no event will the authors be held liable for any
; damages arising from the use of this software.
;===============================================================================
; Function list
;===============================================================================
_SQLite_Startup
_SQLite_Shutdown
_SQLite_OpenDB
_SQLite_CloseDB
_SQLite_GetTable
_SQLite_Exec
_SQLite_LibVersion
_SQLite_LastInsertRowID
_SQLite_GetTable2d
_SQLite_Changes
_SQLite_TotalChanges
_SQLite_ErrCode
_SQLite_ErrMsg
_SQLite_Display2DResult
_SQLite_FetchData
_SQLite_Query
_SQLite_SetTimeout
_SQLite_SaveMode
_SQLite_QueryFinalize
_SQLite_QueryReset
_SQLite_FetchNames
_SQLite_QuerySingleRow
_SQLite_SQLiteExe
_SQLite_Encode
_SQLite_ExtractInt
;===============================================================================
; User Calltips:
;===============================================================================
_SQLite_Startup() Loads SQLite3.dll
_SQLite_Shutdown() Unloads SQLite3.dll
_SQLite_Open([$sDatabase_Filename]) Opens Database, Sets Standard Handle, Returns Handle
_SQLite_Close([$hDB]) Closes Database
_SQLite_GetTable($hDB | -1 , $sSQL , ByRef $sResult , ByRef $iRows , ByRef $iColumns , [$iCharSize = 64]) Executes $sSQL Query to $sResult, Returns Error Code
_SQLite_Exec($hDB | -1 , $sSQL) Executes $sSQL (No Result), Returns Error Code
_SQLite_LibVersion() Returns Dll's Version No.
_SQLite_LastInsertRowID($hDB) Returns Last INSERT ROWID
_SQLite_GetTable2d($hDB | -1 , $sSQL , ByRef $aResult , ByRef $iRows , ByRef $iColumns , [$iCharSize = 64], [$fSwichDimensions = False]) Executes $sSQL Query to $aResult, Returns Error Code
_SQLite_Changes([$hDB]) Returns Number of Changes (Excluding Triggers) of The last Transaction
_SQLite_TotalChanges([$hDB]) Returns Number of All Changes (Including Triggers) of all Transactions
_SQLite_ErrCode([$hDB]) Returns Last Error Code (Numeric)
_SQLite_ErrMsg([$hDB]) Returns Last Error Message
_SQLite_Display2DResult($aResult , [$iCellWidth = 0], [$fReturn = False]) Returns or Prints a 2d Array to console
_SQLite_FetchData($hQuery, ByRef $aRow, [$fBinary = False] ) Fetches Results From First/Next Row of $hQuery Query into $aRow, Returns Error Code
_SQLite_Query($hDB | -1 , $sSQL , ByRef $hQuery) Prepares $sSql, Returns Error Code
_SQLite_SetTimeout([$hDB = -1] , [$iTimeout = 1000]) Sets Timeout for busy handler
_SQLite_SaveMode($fSaveModeState) Turn Savemode On or Off (boolean)
_SQLite_QueryFinalize($hQuery) Finalizes a Query
_SQLite_QueryReset($hQuery) Resets a Query
_SQLite_FetchNames($hQuery, ByRef $aNames) Read out the Tablenames of a _SQLite_Query() based query
_SQLite_QuerySingleRow($hDB | -1 , $sSQL , ByRef $aRow) Read out the first Row of the Result from the Specified query
_SQLite_SQLiteExe( $sDatabaseFile , $sInput , ByRef $sOutput , $sSQLiteExeFilename = "SQLite3.exe" ) Executes commands in SQLite.exe
_SQLite_Encode($vData) Returns Encoded String
;===============================================================================
; Changelog:
;===============================================================================
*/
#NoEnv
#SingleInstance force
SetBatchLines -1
SetWinDelay -1
;===============================================================================
; SQLite Returncodes
;===============================================================================
$SQLITE_OK := 0            ; /* Successful result */
$SQLITE_ERROR := 1         ; /* SQL error or missing database */
$SQLITE_INTERNAL := 2      ; /* An internal logic error in SQLite */
$SQLITE_PERM := 3         ; /* Access permission denied */
$SQLITE_ABORT := 4         ; /* Callback routine requested an abort */
$SQLITE_BUSY := 5         ; /* The database file is locked */
$SQLITE_LOCKED := 6         ; /* A table in the database is locked */
$SQLITE_NOMEM := 7         ; /* A malloc() failed */
$SQLITE_READONLY := 8      ; /* Attempt to write a readonly database */
$SQLITE_INTERRUPT := 9      ; /* Operation terminated by sqlite_interrupt() */
$SQLITE_IOERR := 10         ; /* Some kind of disk I/O error occurred */
$SQLITE_CORRUPT := 11      ; /* The database disk image is malformed */
$SQLITE_NOTFOUND := 12      ; /* (Internal Only) Table or record not found */
$SQLITE_FULL := 13         ; /* Insertion failed because database is full */
$SQLITE_CANTOPEN := 14      ; /* Unable to open the database file */
$SQLITE_PROTOCOL := 15      ; /* Database lock protocol error */
$SQLITE_EMPTY := 16         ; /* (Internal Only) Database table is empty */
$SQLITE_SCHEMA := 17      ; /* The database schema changed */
$SQLITE_TOOBIG := 18      ; /* Too much data for one row of a table */
$SQLITE_CONSTRAINT := 19   ; /* Abort due to constraint violation */
$SQLITE_MISMATCH := 20      ; /* Data type mismatch */
$SQLITE_MISUSE := 21      ; /* Library used incorrectly */
$SQLITE_NOLFS := 22         ; /* Uses OS features not supported on host */
$SQLITE_AUTH := 23         ; /* Authorization denied */
$SQLITE_ROW := 100         ; /* sqlite_step() has another row ready */
$SQLITE_DONE := 101         ; /* sqlite_step() has finished executing */
;===============================================================================
; SQLite Constants
;===============================================================================
$SQLITE_DBHANDLE := 1      ; /* (Internal Only) Database Handle (sqlite3*) */
$SQLITE_QUERYHANDLE := 2   ; /* (Internal Only) Query Handle (sqlite3_stmt*) */
;===============================================================================
; SQLite Globals
;===============================================================================
$g_sDll_SQLite := A_ScriptDir . "\SQLITE3.DLL"
$g_hDll_SQLite := 0
$g_sDB_SQLite := A_ScriptDir . "\Telefon.db"
$g_hDB_SQLite := 0
;===============================================================================
; Function Name:    _SQLite_StartUP()
; Description:      Loads SQLite3.dll
; Parameter(s):      None
; Requirement:      SQLite3.dll must exist in A_ScriptDir
; Return Value(s):  On Success - $SQLITE_OK
;                   On Failure - ErrorLevel
; Author(s):      nick
;===============================================================================
_SQLite_Startup()
{
   Global
   $g_hDll_SQLite := DllCall("LoadLibrary", "str", $g_sDll_SQLite)
   If (ErrorLevel <> 0)
   {
      Return ErrorLevel
   }
   Return $SQLITE_OK
}
;===============================================================================
; Function Name:    _SQLite_Shutdown()
; Description:      Unloads SQLite3.dll
; Parameter(s):      None
; Requirement:      None
; Return Value(s):  On Success - $SQLITE_OK
;                   On Failure - ErrorLevel
; Author(s):        nick
;===============================================================================
_SQLite_Shutdown()
{
   Global
   DllCall("FreeLibrary", "UInt", $g_hDll_SQLite)
   If (ErrorLevel <> 0)
   {
      Return ErrorLevel
   }
   $g_hDll_SQLite := 0
   Return $SQLITE_OK
}
;===============================================================================
; Function Name:    _SQLite_OpenDB()
; Description:      Opens a Database
; Parameter(s):     $sDatabase_Filename - Database Filename
;               Optional - (uses ':memory:' db by default)
; Requirement:      None
; Return Value(s):  On Success - $SQLITE_OK
;                   On Failure - ErrorLevel or SQLite_RC
; Author(s):        nick
;===============================================================================
_SQLite_OpenDB($sDatabase_Filename = "")
{
   Local $i_RC
   $i_RC := 0
   If $sDatabase_Filename =
   {
      $sDatabase_Filename := ":memory:"
   }
   $i_RC := DllCall("sqlite3\sqlite3_open"
         , "str", $sDatabase_Filename
         , "Uint *", $g_hDB_SQLite
         , "Cdecl int")
   If (ErrorLevel <> 0)
   {
      Return Errorlevel
   }
   Return $i_RC
}
;===============================================================================
; Function Name:    _SQLite_CloseDB()
; Description:      Closes an open Database
;               Waits until SQLite <> $SQLITE_BUSY until 'Timeout' has elapsed
; Parameter(s):     $hDB - Optional Database Handle
; Requirement:      None
; Return Value(s):  On Success - Returns $SQLITE_OK
;                   On Failure - Errorlevel or SQLite_RC
; Author(s):        nick
;===============================================================================
_SQLite_CloseDB($hDB = -1)
{
   Local $i_RC
   $i_RC := 0
   $i_RC := DllCall("sqlite3\sqlite3_close"
         , "Uint", $g_hDB_SQLite
         , "Cdecl int")
   If (ErrorLevel <> 0)
   {
      Return Errorlevel
   }
   $g_hDB_SQLite := 0
   Return $i_RC
}
;===============================================================================
; Function Name:    _SQLite_GetTable()
; Description:      Passes Out String Containing Tablenames and Data of Executed Query
; Parameter(s):     $hDB - An Open Database, Use -1 To use Last Opened Database
;               $sSQL - SQL Statement to be executed
;               ByRef $sResult       - Passes out the Resultstring or SQLite ErrMsg
;               ByRef $iRowCount    - Passes out the amount of 'data' Rows
;               ByRef $iColCount    - Passes out the amount of Columns
;               $iCharSize - Optional: specifies the maximal size of a Data Field
; Return Value(s):  On Success - Returns $SQLITE_OK
;                   On Failure - ErrorLevel or SQLite_RC
; Author(s):        nick
;===============================================================================
_SQLite_GetTable($hDB, $sSQL, ByRef $sResult, ByRef $iRowCount, ByRef $iColCount, $iCharSize = 64)
{
   Local $i, $i_RC, $iErr, $iOff, $iRow, $iCol, $iResultSize, $pStrPtr, $pResult, $sCol, $sRow
   $i := A_TickCount
   $i_RC := 0
   $pResult := 0
   $iErr := 0
   If ($iCharSize = 0 Or $iCharSize = "" Or $iCharSize < 1)
   {
      $iCharSize := 64
   }
   $i_RC := DllCall("sqlite3\sqlite3_get_table"
         , "Uint", $g_hDB_SQLite
         , "str", $sSQL
         , "Uint *", $pResult
         , "Uint *", $iRowCount
         , "Uint *", $iColCount
         , "Uint *", $iErr
         , "Cdecl int")
   If (ErrorLevel <> 0)
   {
      Return Errorlevel
   }
   If ($i_RC <> $SQLITE_OK)
   {
      $sResult := DllCall("sqlite3\sqlite3_errmsg", "Uint", $hDB, "Cdecl str")
      Return $i_RC
   }
   $iResultSize := ($iRowCount + 1) * $iColCount
   VarSetCapacity($sResult, $iCharSize * $iResultSize)
   $iOff := 0
   Loop % $iRowCount + 1
   {
      $sRow =
      Loop %$iColCount%
      {
         $sCol =
         DllCall("lstrcpyA", "Str", $sCol, "Uint", _SQLite_ExtractInt($pResult, $iOff))
         $sRow = %$sRow%%$sCol%|   
         $iOff += 4
      }
      StringTrimRight $sRow, $sRow, 1
;      MsgBox %$sRow%
      $sResult = %$sResult%%$sRow%`n
   }
   VarSetCapacity($sResult, -1)
   StringTrimRight $sResult, $sResult, 1
   MsgBox % A_TickCount - $i
   Return $i_RC
}
;===============================================================================
; Function Name:    _SQLite_ExtractInt()
; Description:      Extracts an Integer Value from the Address, $pResult points to
; Parameter(s):     $pResult   - Pointer
;               $pOffset   - Offset for Pointer
;               $pIsSigned   - Optional: Signed or Unsigned Integer (Default = False)
;               $pSize      - Optional:   Size of Returnvalue (Default = 4)
; Return Value(s):  Returns Integer Value of specified length
; Author(s):        Chris Mallett & nick
;===============================================================================
_SQLite_ExtractInt(ByRef $pResult, $pOffset = 0, $pIsSigned = false, $pSize = 4)
{
   Local $i_RC
   $i_RC := 0
   ; Build the integer by adding up its bytes
   Loop %$pSize%
   {
      $i_RC += *($pResult + $pOffset + A_Index-1) << 8*(A_Index-1)
   }
   If (!$pIsSigned OR $pSize > 4 OR result < 0x80000000)
   {   ; Signed vs. unsigned doesn't matter in these cases
      Return $i_RC
   }
   Else
   {   ; Otherwise, convert the value (now known to be 32-bit) to its signed counterpart
      Return -(0xFFFFFFFF - $i_RC + 1)
   }
}
;===============================================================================
;   Test Section
;===============================================================================
$iRows := 0
$iCols := 0
$sResult := ""
$sSQL := "SELECT * FROM Telefon Where Abteilung = 'P & O';"
$iRC := 0
$iRC := _SQLite_Startup()
If ($iRC <> 0)
{
   MsgBox Fehler bei STARTUP: %$iRC%
}
$iRC := _SQLite_OpenDB($g_sDB_SQLite)
If ($iRC <> 0)
{
   MsgBox Fehler bei OPENDB: %$iRC%
}
$iRC := _SQLite_GetTable($g_hDB_SQLite, $sSQL, $sResult, $iRows, $iCols)
If ($iRC <> 0)
{
   MsgBox Fehler bei GETTABLE: %$iRC%
}
Msgbox Zeilen : %$iRows%, Spalten : %$iCols%
$iRC := _SQLite_CloseDB($g_hDB_SQLite)
If ($iRC <> 0)
{
   MsgBox Fehler bei CLOSEDB: %$iRC%
}
$iRC := _SQLite_ShutDown()
If ($iRC <> 0)
{
   MsgBox Fehler bei SHUTDOWN: %$iRC%
}
ExitApp



_SQLite_GetTable passes out the result of a QUERY to a string where column values are seperated by "|" and rows are seperated by LF.

It's even faster then AU3 (that's why I love AHK), but btw, can anybody explain, why the compiled version is about 30 % slower than the source version?

It was a hard job for an elder HOST programmer so far, but if there is any need for other functions, I'll go on.

Have a lot of fun!
Back to top
BoBo
Guest





PostPosted: Tue Sep 12, 2006 4:34 pm    Post subject: Reply with quote

@ Guest/Gast
das nen ich doch beeindruckend Very Happy . Im Deutschen Forum darfst du mir (und Millionen anderen Wink), dein Einverständnis vorausgesetzt, gerne AHK's DllCall() erklären.
Bis dann dann & thx for sharing it! Very Happy

... and yes, I'd like you'd use a nick Wink
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue Sep 12, 2006 10:00 pm    Post subject: Reply with quote

Quote:
supporting direct use of SQLite3.DLL and SQLite3.exe.
Thanks for posting the script.

Quote:
can anybody explain, why the compiled version is about 30 % slower than the source version?
The ahk2exe version of AutoHotkey.exe favors small code over fast code, but only for sections that are the least performance-sensitive. Apparently, your script is atypical enough to suffer from the difference anyway. I could send you an alternate version of AutoHotkeySC.bin if you wish to confirm (if interested, please e-mail support@autohotkey.com).
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group