Page 1 of 1

Connect to SQLite problem

Posted: Tue Jul 22, 2014 8:37 pm
by Rob van der Sloot
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

Re: Connect to SQLite problem

Posted: Tue Jul 22, 2014 8:49 pm
by FourthWorld
Try using the complete file path in the third argument.

Re: Connect to SQLite problem

Posted: Wed Sep 03, 2014 7:25 pm
by sturgis
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