sqlite

Blitz3D Forums/Blitz3D Beginners Area/sqlite

Jamie Priest(Posted 2004) [#1]
Has anyone had success in connecting to this? I've attempted to load the sqlite.dll and created a sqlite.decls file. However I haven't had much success. It seems that my calls to the sqlite_open function/class have some effect but I fear the sqlite.dll is not compatible with Blitz3d. For example the sqlite_open function returns a pointer to a sqlite database object, can Blitz handle this pointer with it's internal data types? If so how? Or is the answer to do with some magic Data,pokes or peeks? Or would a new sqlite dll need to be created?

Many thanks

Jamie


Ice9(Posted 2004) [#2]
Try here
http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers&1055082133

and look at this
http://www.purearea.net/pb/download/userlibs/SQLite_1.33.zip

You may find your answer there. Also try creating a bank like the sqlite data types


I believe someone did a MySql thing in blitz.

If you can figure out the Telnet communication to Mysql I would assume you could send queries and retrieve data quite
easily


TeaVirus(Posted 2004) [#3]
Give BlitzData a try:

http://www.blitzbasic.com/toolbox/toolbox.php?tool=34

You would just need to fugure out what the porper connection string is. I'm currently using it in a project and it works very well.


Jamie Priest(Posted 2004) [#4]
Thanks for the replies, I have looked at the wrappers for sqlite on the sqlite website but none of them would appear to be as useful as the original dll that is made available. Interesting to note that specific wrappers have been built for other languages, perhaps one needs to be build specifically for Blitz?

I'm not sure how to construct a data bank correctly? As far as I'm aware the pointer returned by sqlite should be just a hex value? how many bytes, 32?. Anyway all my attempts to store this pointer have resulted in "Illegal type conversion" errors regardless of whether I assign it to a variable or try to stuff it in a bank?

It looks like I'll have to employ a flat file or use Blitz Data instead.

If anyone with some C++ skills fancies altering the sqlite dll so that it's easy to use with Blitz, feel free to let me know. Or if sqlite is easy to integrate with Blitz and someone wants to let me know how, please post to this thread.


Ice9(Posted 2004) [#5]
Instead of a flatfile you could put tags that could be
parsed in one file to link that flatfile to another
flatfile. Or use key values in one to link to another


Jamie Priest(Posted 2004) [#6]
Thanks, yes I'll consider using your suggested method. It is unlikely the data will require random access or that the data will be particularly large collection. I may consider just wrapping it up in XML....


Ice9(Posted 2004) [#7]
Blitztastic put that in the code archive.
XML parser
http://www.blitzbasic.com/codearcs/codearcs.php?code=361


HappyCat(Posted 2005) [#8]
I know this is a really old thread, but I'm just chuffed to bits that I got this working :-)