Jump to content

SQLite semi Embedded database functionality in AutoIt


ptrex
 Share

Recommended Posts

Changed _SQLite_FetchData() Binary Mode

Removed _SQLite_GlobalRecover() out-of-memory recovery is automatic since SQLite 3.3.0

Changed @error Values & Improved error catching (see Function headers)

SQLite.zip

Binary support at Last :)

@jpm

You where absolutely right. @error setting needed a Makeup

@JSThePatriot

Just '_SQLite_Open()' it, it will be created

or create a 0 byte file with AutoIt's File* functions if you want to do it manualy

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Changed _SQLite_FetchData() Binary Mode

Removed _SQLite_GlobalRecover() out-of-memory recovery is automatic since SQLite 3.3.0

Changed @error Values & Improved error catching (see Function headers)

SQLite.zip

Binary support at Last :)

@jpm

You where absolutely right. @error setting needed a Makeup

@JSThePatriot

Just '_SQLite_Open()' it, it will be created

or create a 0 byte file with AutoIt's File* functions if you want to do it manualy

I had tried that, and it didnt create a file. Maybe I was doing something else wrong.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Changed _SQLite_FetchData() Binary Mode

Removed _SQLite_GlobalRecover() out-of-memory recovery is automatic since SQLite 3.3.0

Changed @error Values & Improved error catching (see Function headers)

SQLite.zip

Binary support at Last :)

@jpm

You where absolutely right. @error setting needed a Makeup

@JSThePatriot

Just '_SQLite_Open()' it, it will be created

or create a 0 byte file with AutoIt's File* functions if you want to do it manualy

Just another way to return error for your learning ... :(
Link to comment
Share on other sites

... I allways wondered why there is a way to specify SetError()'s Return value :(

until the man with the 'Insight' showd me. (Realy i didnt get this one)

Thanks JP! :)

I wonder if it would make sence to include sqlite3.dll as inline binary file.

And Modify _SQLite_Startup() to drop it into %temp% dir and load it from there if no dll is specifyed, if it was included.

So nobody has to worry about the dll converting to exe...

But the binary data is smaller (about 50% smaller) and FileInstall() is Faster and Compression is better...

But it would be very nice to do a '_SQLite_Startup()' and dont worry about the rest. :D

There is a very simple 'inline include' file of sqlite3.dll 3.3.5 attached to this post.

Using Larry's wrapper for FileIO API - also included - Thanks Larry :oops:

Please tell me what you thing about this idea.

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

... I allways wondered why there is a way to specify SetError()'s Return value :(

until the man with the 'Insight' showd me. (Realy i didnt get this one)

Thanks JP! :)

I wonder if it would make sence to include sqlite3.dll as inline binary file.

And Modify _SQLite_Startup() to drop it into %temp% dir and load it from there if no dll is specifyed, if it was included.

So nobody has to worry about the dll converting to exe...

But the binary data is smaller (about 50% smaller) and FileInstall() is Faster and Compression is better...

But it would be very nice to do a '_SQLite_Startup()' and dont worry about the rest. :D

There is a very simple 'inline include' file of sqlite3.dll 3.3.5 attached to this post.

Using Larry's wrapper for FileIO API - also included - Thanks Larry :oops:

Please tell me what you thing about this idea.

@picasso

It is not a bad idea to have it included , but I would drop it in the Windows Dir and not in the TEMP dir.

Because the Temp dir is cleaning out from time to time (TEMP means TEMPORARY :( )

ptrex

Edited by ptrex
Link to comment
Share on other sites

@picasso

It is not a bad idea to have it included , but I would drop it in the Windows Dir and not in the TEMP dir.

Because the Temp dir is cleaning out from time to time (TEMP means TEMPORARY :( )

ptrex

perhaps t could be good to set the right filedate. I always go to a stable date when I am looking for a versioning. I notice this dll as version, if it can be added during the link that could be another way to know the version with the explorer.exe :)
Link to comment
Share on other sites

I would like to avoid conflicts in the system directory.

how about Dropping it to @SystemDir if it doesent exist.

And if it does exist drop it to @TempDir and remove it on _SQLite_Shutdown() ?

And of course set propper filedate (JP your right, Filedate is essential in that case) :)

edit: just a thaugt: Do non Administator users have write premissions in @SystemDir ?

Edited by piccaso
CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

@picasso

I am not much in favour of writing and then deleting.

This is unneeded I/O transactions. Once it's there it's there to stay.

Unless the user wants to decide to move to a new upgraded version.

But I think this is something the user should decide not us.

But this is personal of cource. :)

Edited by ptrex
Link to comment
Share on other sites

I am just curious as to how you guys are going to file install this? I have not seen a single compiled script let alone installation program.

If you are interested in giving options, but at the same time allowing them to install then maybe you should either write an install, or use something like Inno Setup (my personal fav).

IMHO,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

I am just curious as to how you guys are going to file install this? I have not seen a single compiled script let alone installation program.

If you are interested in giving options, but at the same time allowing them to install then maybe you should either write an install, or use something like Inno Setup (my personal fav).

IMHO,

JS

I think the Picasso idea is to have a regular include which will be binded with the standard include files. A little bigger than the other but why not. :)
Link to comment
Share on other sites

@JSThePatriot

Why use "Inno Setup" when there is :

regards

I was talking more along the lines of an actual setup.exe installation program. Can this be done with AutoIt yes... it has already been done with Inno Setup with nice GUI and all so it would be at this point for a single project too much to recreate the wheel. It seems you guys are trying to "Include" an exe in a non-compiled script as there isnt a single include that is compiled. FileInstall wont really include the file with the au3 script file unless compiled.

I think the Picasso idea is to have a regular include which will be binded with the standard include files. A little bigger than the other but why not. :)

I still dont see how this will have the sqlite3.dll "included" in the script. Maybe I missed the point totally.

BTW I am having a bit of troubles. I can get the example_browser.au3 to work, but am unable to get my own ClosedFiles.au3 to open SQLite3.dll.

The code...

#include "SQLite.au3"
    ;Start SQLite and SQL Operations
    _SQLite_Startup("sqlite3.dll")
    If @error = 1 Then
        MsgBox(0, "", "Error loading SQLite.dll")
        Return
    EndIf
    _SQLite_Open("fif.db")
    If @error > 0 Then
        MsgBox(0, "ERROR", "Error loading Database")
        Return
    EndIf

sqlite3.dll and fif.db are both in the same directory as closedfiles.au3. I everytime get the error "Error loading SQLite.dll". When I run the example_browser.au3 I dont get this error even though I have copied and pasted the code directly.

I really dont understand it...I have even tried moving my script into the same directory with the example_browser.au3.

Any help would be greatly appreciated.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

@JSThePatriot

_SQLite_Startup("sqlite3.dll")

According to me this should contain the full path to the DLL.

OR

you can copy the DLL to tha c:\Windows Dir where Windows will find it automatically.

@piccaso

That's why I don' t think that it is a good idea to have it dropped in the TEMP dir !!

Better is the Windows or System32 Dir to avoid these kind of problems.

Link to comment
Share on other sites

If the DLL is contained in the script folder then would I really need a full path or to have it in the SysDir or WinDir? If I put it in those directories I will have to register it for it to be found. As it sits it should find it in the current directory... oh wait a min... my directory isnt in the script directory... ahh... I will post in a sec to see if that fixes my problem. My script jumps directories all over the place.

Edit: DOH! That is correct. I had forgotten all about my FileChangeDir() function calls!

JS

Edited by JSThePatriot

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

I'll Try to explain what i suggested. For example:

if Sqlite.dll.au3 was included before ( #include <SQLite.dll.au3> ) Then

Inside _SQLite_Startup()

If there is no dll specifyed Then the script will try to...

Load it from Current/System Dir But if its not there or the binded version is newer...

Put it into @systemdir whithout replaceing an existing version - maybe there should be an option to force replacement.

If this Fails for some reason (User premissions, Systemdir is Readonly like in PE builds, ...)

It will put it into Temp dir, having a temp filename...

Inside _SQLite_Shutdown()

if the dll was Droped into the temp dir it will be removed

if Sqlite.dll.au3 was not included then

This Wrapper will behave like it does now

So the author can choose between #include'ing the dll inline or Howerver he likes to (Fileinstall,Installer...)

:)

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Update LiteX to SQLite version 3.3.5

The developer of the SQLite Wrapper has not sat still. He has released some new updates this year.

Including some new functions as well.

Download the update here : LiteX COM wrapper 3.3.5

When you plan to upgrade you need to reregister the DLL again because of it's new funtionalities exposed.

What strilkes me the most, is that this last distribution INCLUDES AutoIT Sample scripts.

Look in :

\script\VBSample\LiteXSample.au3 (Author Wayne Graham)

\script\AutoIt3Beta\ XXX.au3

Definitely AutoIT has been a stimulation for the developer to go ahead with his development.

You should try this ExecSql.au3 script. It creates a TreeView dynamically, because the data for it is stored in the DB.

This means that he also acknowledge the power of SQLite and AutoIT.

I think this calls for a celebration :D

Congratulation to all the AutoIT Developers and Scripters as well.

Edited by ptrex
Link to comment
Share on other sites

Congratulations to SQLite Developers and AutoIt Developers for this mutual understanding between the two products.

Congratulations to Picasso, JPM, and PTrex for all your hard work in making this a reality in AutoIt.

SQLite is working wonders for me. I have almost finished my FIF (File-Index-Find) program.

The only thing I am working on (not having to do with SQLite, but just a comment on my progress) is ListViewItems() I do believe I will be submitting some examples for the helpfile to help those that may come upon the same problem I have had with updating them dynamically.

Thanks again and enjoy,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Updated...

JPM's Nice @error values setting

Inline SQLite3.dll

SQLite.zip

Fine job :D

Some more comments.

1. why to keep those to similar functions. _SQLite_Exec and _SQLite_Execute.

Personnally I don't like too much those ErrorMsg/Charsize.

I will suggest we remove them in _SQLite_GetTable2d,_SQLite_GetTable too and remove _SQLite_Exec.

2. why don't have a way to create permanently the SQLite3.dll with the Inline stuff.

3. I don't know who is compiling Sqlite3.dll and sqlite.exe but tell him to have a version property.

4. it could be good to have the same programming functions as in Php_sqlite. I don't know if it is really possible.

Cheers :D

Link to comment
Share on other sites

Updated...

JPM's Nice @error values setting

Inline SQLite3.dll

SQLite.zip

WOW I now understand what you meant by "inline". I like that a whole lot.

Might I ask exactly how you did that? A Hex Editor of the file perhaps?

That is something I would like to do with my File-String Hash functions.

Thanks,

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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