Current Status of El Choni's SQLite Library?

Everything else that doesn't fall into one of the other PB categories.
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

That is what you are trying to do with SQLiteExec(SQL), access the database :-)
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Mitch,

Right! SQLiteExec writes data to the database.
But the problem is that I don't get an error when I try to read data using SQLiteGetTable().
I would expect an error when trying to read or write a disconnected database.

Eric
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

SQLiteExec runs an SQL query, which could read or write to the database depending on the query..

I would say that the results of a SELECT are stored in memory for access (probably why you can loop through a result set after the database is gone).. You should get an error the next time the library needs to look at the database file - which should be upon initial execution of the query and gathering of results (be that query a SELECT,INSERT,UPDATE or the like)..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Do a FileSize() on the database file to see if it still exists before trying to run any queries on it..
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

Mitch,

By definition, SQLiteExec only executes INSERT or UPDATE queries, which DO NOT return any results. SQLiteGetTable runs SELECT queries which return data which is indeed stored in memory. When you execute SQLiteRemoveData(), retrieved table data is removed from memory.

The question remains: why does SQLiteGetTable() return a 0 (success) when it can not connect to the database file, because the network is disconnected?
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

If I could read it would help - wouldn't it!

I don't know why one would return success and the other fail.. Crazy for sure..

Smack me. It's early and I haven't had any coffee.
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

If SQLiteGetTable() returns 0, it has failed (it's different from the other functions). The returned value is a pointer to a strings array with the returned data.

Regards,
El_Choni
ebs
Enthusiast
Enthusiast
Posts: 561
Joined: Fri Apr 25, 2003 11:08 pm

Post by ebs »

El,

So that's it!

There's an error in your SQLite.txt help file, because the description of SQLiteGetTable() says:

- IMPORTANT: result=0 means the function succeeded. If you get any other return value, call SQLiteError(result) to find out the error.

Eric
Klonk
Enthusiast
Enthusiast
Posts: 173
Joined: Tue Jul 13, 2004 2:17 pm

Post by Klonk »

Are there any plans to adept the Userlib to work with SQLite 3.0.x? Or does it already work with it (I don't think so)?
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Hi,

Next SQLite PureLibrary release will support both SQlite 2 and SQLite 3 dlls. Since this release has been waiting too much, my plan is to delay the release of the final version of TailBite (which will be, anyway, much like the current beta plus some goodies) and concentrate in SQLite.

Any suggestions are welcome, although I think the current wrapping functions set is enough.

Regards,
El_Choni
Klonk
Enthusiast
Enthusiast
Posts: 173
Joined: Tue Jul 13, 2004 2:17 pm

Post by Klonk »

Nice to hear that, thanks.

Tailbite = really cool and useful piece of software. Thanks for sharing BTW
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Any way to have something like a recordset (vb term, I guess), maybe something like a structure that is filled with records so it'll be easier to move through them or some such? nvm, i donno.
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

I don't know if this is what you mean... You can access the data from a table with an *array(), as the example included with SQLite shows. But you can also use SQLiteData().
El_Choni
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

Hey Choni - any status updates for us?
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

Thanks for the answer Chron :)

But if its access via an array, and different fields have different types (aka, string, long, etC), and since PB Arrays cannot handle different types...how does that work?

Also, any updates on this lib? :D
Post Reply