Downloading file from database and modifying..

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Downloading file from database and modifying..

Post by tasdvl9 » Mon Jan 27, 2014 8:41 pm

Hello,

I'm in the process of using WordReport to manipulate fields in a report.

My ultimate goal is to download a file(Microsoft word or Open Office format) from a database and then edit the
fields and upload it back to the data base.

I guess my first question is if there is any sample code which does this already or what is the procedure or function call
used to download files from a server/database?

Thanks!

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Downloading file from database and modifying..

Post by MaxV » Tue Jan 28, 2014 10:46 am

The function you need is revOpenDatabase, here is an example:

http://livecode.wikia.com/wiki/SQLite

to upload you just to enter the correct query using variable form:

Code: Select all

revExecuteSQL myID, "insert into mytable( name, file) values ('myFirstDoc', :1)", "*bMyWord"
To pass binary data in a variable in the variablesList, prepend "*b" to the variable name. The revExecuteSQL command strips the binary marker "*b" and passes it to the database as binary data, rather than text data.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply