Connect to SQLite problem

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, asayd

Post Reply
Rob van der Sloot
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 78
Joined: Sat Apr 17, 2010 9:21 am

Connect to SQLite problem

Post by Rob van der Sloot » Tue Jul 22, 2014 8:37 pm

After some time out of LC, I wanted to do some research into connecting to a SQLite database, but are confronted with problems.
Can someone tell me why I get an integer problem with the following script? The answer I get is " "tConID is not an integer: Problem creating or accessing database!"

on mouseUp
global gConID
local tConId

put revOpenDatabase("sqlite","E:\Software\SQLite\SQLiteDBs","TestDB12.sqlite",,,,,,) into tConID

if tConID is empty then
answer warning "tConID is empty: Problem creating or accessing database!"
exit to top
else
if tConID is not an integer then
answer warning "tConID is not an integer: Problem creating or accessing database!"
exit to top
end if
else
answer information "Database is created! " & return & "The connection ID is: " & tConID
put tConID into gConID
end if
end mouseUp

Thanks
Rob van der Sloot

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Connect to SQLite problem

Post by FourthWorld » Tue Jul 22, 2014 8:49 pm

Try using the complete file path in the third argument.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Connect to SQLite problem

Post by sturgis » Wed Sep 03, 2014 7:25 pm

The example from the dictionary for sqlite is this: revOpenDatabase("sqlite",filepath,[sqliteOptions])
So, you'd want to instead do something like this..
put revOpenDatabase("sqlite","E:\Software\SQLite\SQLiteDBs\TestDB12.sqlite") into tConID

Post Reply

Return to “LiveCode University”