Email SQLite Database

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
wunder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Wed Feb 01, 2012 6:18 am

Email SQLite Database

Post by wunder » Fri Dec 14, 2012 6:12 pm

Hello- still newbie here. I've developed a prototype application that stores data in a SQLite database. Now I'm trying to get the database off the iphone and back to my desktop PC. There doesn't appear to be a way to copy the file directly, so I thought I'd try using the mobileComposeMail command. However, when the email opens, it does not appear to contain an attachment and when I receive it, there is no attachment. Here's my code- I realize the attachment type is wrong, but I was expecting to just receive a text file with the name of the database at this point... I also changed my email address so it's not posted. Thanks in advance.

if the environment = "mobile" then
put DatabasePath into tAttachment["data"]
put "text/plain" into tAttachment["type"]
put "MeteorCount.SQLite" into tAttachment["name"]
mobileComposeMail "Meteor Data " & date(), "myemail@myserver.com",,"Here is the SQLite Database",tAttachment
end if

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: Email SQLite Database

Post by gpb01 » Fri Dec 14, 2012 6:55 pm

If you copy your DB into the "documents" directory [ specialFolderPath("documents") ] and you enable the "File Sharing" flag on the Standalone Application settings, you can access the folder directly from iTunes to read/write files. :)

Guglielmo

wunder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Wed Feb 01, 2012 6:18 am

Re: Email SQLite Database

Post by wunder » Fri Dec 14, 2012 7:18 pm

Sweet- thanks! Works great.

I would still like to know how to attach the database to an email if anyone has an answer to that.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: Email SQLite Database

Post by monte » Fri Dec 14, 2012 8:15 pm

mobilecomposemail has an attachment parameter
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

wunder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Wed Feb 01, 2012 6:18 am

Re: Email SQLite Database

Post by wunder » Fri Dec 14, 2012 8:33 pm

Do you mean something different from what I posted in my code?

strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 146
Joined: Mon Jul 31, 2006 1:39 am
Contact:

Re: Email SQLite Database

Post by strongbow » Fri Dec 14, 2012 11:42 pm

You might want to base64encode the DB before you send it in mail.. or zip + encode it before sending as attachment...?

Ahh - just checked the iOS release notes and this doesn't seem necessary - sorry...!
Last edited by strongbow on Sat Dec 15, 2012 1:18 pm, edited 1 time in total.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Email SQLite Database

Post by Mark » Sat Dec 15, 2012 12:49 pm

Hi,

It looks like a comma is missing:

Code: Select all

mobileComposeMail "Meteor Data " & date(), "myemail@myserver.com",,,"Here is the SQLite Database",tAttachment
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

wunder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 18
Joined: Wed Feb 01, 2012 6:18 am

Re: Email SQLite Database

Post by wunder » Sat Dec 15, 2012 5:36 pm

Whoops- thanks so much and sorry about the dumb question! I'm a noobie with livecode, but I've been coding for 25 years and should know better than that! It's working now. :oops:

Post Reply