• Welcome, Guest. Please login.
October 18, 2021, 11:16:43 PM


Welcome to the SQLitening support forums!

SQLiteningProcs - How to store a BLOB using SQlite

Started by Bern Ertl, May 26, 2009, 06:01:41 PM

Previous topic - Next topic

Bern Ertl

I've got a string of binary data that I want to read/write to the database from a SQLiteningProcs DLL (which requires accessing the db directly with SQLite instead of the SQLitening wrapper).  How can I do this?

Fred Meier

I will add an example of binding BLOB to SQLiteningProcsA.Bas.  It will
take some time so if you are in hurry, use the code (local mode) in the
slExeBind function as your guide. 

Here is an overview -- it requires four calls to SQLite as follows:
   1. Prep Statement
   2. Bind each entry (do this for each field)
   3. Step It
   4. Finalize It

Bern Ertl

Thanks Fred, your example would be very helpful.  I also need to know how to write the field/column.

Fred Meier

Attached is a new SQLiteningProcsA.Bas which now includes example of
inserting rows using bind_blob and bind_text.  There is nothing special
about getting a blob field.  A string value is always returned. 

Bern Ertl

Thanks Fred.  Looks like it's a two part process with slmPrep and slmBindxxxx. 

Am I understanding correctly that slmF will return the binary string data without any special handling?

Fred Meier

Correct, slmF will work with binary data.  The example in SQLiteningProcsA.Bas now also retrieves the data.