New SQLite binary option

Peter Haworth pete at lcsql.com
Tue Nov 11 20:41:36 EST 2014


Has anyone used the new "binary" parameter to revOpenDatabase when opening
an sqlite database?  It's supposed to store binary data into BLOB columns
unchanged - apparently Livecode used to store BLOB's in a proprietary
format.

Here's what I'm doing:

revOpendatabase("sqlite",<path to dbfile>,"binary")
   database is opened OK and I can access it

I have a button that opens a pdf file, reads it all into a variable named
tData, then:

revExecuteSQL gDBID,<Update statement>,"*btData"
   which, according to the result, works OK

I can read the data back in again with a SELECT statement and it is
correctly identified by my read handler as a pdf file.  I write the data to
a temporary file with a .pdf extension then launch the file.

At that point, Preview says the file is damaged or not in a format it
recognizes.

If I use Preview to open the original pdf file, it opens with no problem.

To check out what's going on, I wrote the contents of the same pdf file to
a custom property, read the custom property into a variable, wrote the
variable into a temp file, then launched the temp file and this time
Preview opened it with no problem.

I guess that's a long winded way of saying that maybe the new sqlite binary
mode is not working?

Looking for feedback from anyone who has used the new binary mode in a
similar way.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>



More information about the use-livecode mailing list