SQLite Stack

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
wake
Posts: 21
Joined: Thu Jun 25, 2009 6:15 pm

SQLite Stack

Post by wake » Wed Feb 24, 2010 4:52 pm

I have downloaded the SQLite stack from the resource center, but am having issues running the create database portion of the stack.

I went ahead a setup a very simple example that looks like so:

on preOpenCard
put specialFolderPath("Documents") & "/AppReg3.db" into myPath
answer myPath
global gConID
put revOpenDatabase("sqlite", myPath, , , , ) into tConID

if tConID is "" then
answer warning "Problem creating or accessing database!"
else
answer information "AppReg Connected! Your connection ID is: " & tConID
put tConID into gConID
end if
end preOpenCard


When I run this I get the following error:
card id 1002: execution error at line 5 (Function: error in function handler) near "revOpenDatabase", char 8

I am running Windows 7, could that be the problem here? I swear I remember getting this to work quite easily in the past.
I get a similar error message when I run through the SQLite stack from the resource center. Any ideas?

Thanks in advance,
Wake

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: SQLite Stack

Post by bangkok » Wed Feb 24, 2010 4:58 pm

Your script works fine with me (XP, and RunRev 4 and 3.5)

wake
Posts: 21
Joined: Thu Jun 25, 2009 6:15 pm

Re: SQLite Stack

Post by wake » Wed Feb 24, 2010 5:08 pm

bangkok wrote:Your script works fine with me (XP, and RunRev 4 and 3.5)
bangkok,
Thanks for the feedback! I was pretty sure that I had used this almost exact same code before with no problems.

Hmm...I wonder if this is a Windows 7 compatibility issue then. Anyone out there running Windows 7 that could test this out?

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: SQLite Stack

Post by bangkok » Wed Feb 24, 2010 6:55 pm

wake wrote: Hmm...I wonder if this is a Windows 7 compatibility issue then. Anyone out there running Windows 7 that could test this out?
You could maybe change your script, make it more simple. remove the preopencard handler, and give an absolute file path for the SQL file (instead of specialFolderPath), and change the location of the file (in on directory at the first level of your C drive) etc.

wake
Posts: 21
Joined: Thu Jun 25, 2009 6:15 pm

Re: SQLite Stack

Post by wake » Thu Feb 25, 2010 4:15 pm

Chalk this up to stupidity. I just realized that I had been working in revMedia and not revStudio.
It appears that revMedia does not support "revOpenDatabase".

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: SQLite Stack

Post by bangkok » Thu Feb 25, 2010 5:55 pm

wake wrote:Chalk this up to stupidity. I just realized that I had been working in revMedia and not revStudio.
It appears that revMedia does not support "revOpenDatabase".
.-)

That's a good one indeed.

It's confirmed on RunRev's website.

http://revmedia.runrev.com/beginners-gu ... e-anytime/

Post Reply