Hi,
I'm totally new to this and am trying to work out how to connect to / create a sqlite db without using on mouse up. I'd like to connect / create the database automatically when the program starts. Can anybody help?.
Thx,
John
Help on on pre??
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Youy can put something like this in the script of the first card of your stack
HTH,
Jan Schenkel.
Code: Select all
on openStack
local tPrefsPath, tDbPath
put specialFolderPath("Preferences") into tPrefsPath
put tPrefsPath & slash & "MyApp.db" into tDbPath
global gConnectionId
put revOpenDabase("sqlite", tDbPath, , , , ) into gConnectionId
if gConnectionId is not a number then
answer error "Could not create or open database:" && tDbPath
end if
end openStack
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
-
- Posts: 3
- Joined: Wed May 13, 2009 4:54 pm
on Pre
Hi Jan,
Thx for the reply....It's coming up with an error:
stack "Invoice Register": execution error at line 6 (Function: error in function handler) near "revOpenDabase", char 7
Any ideas?.
Thx,
John
Thx for the reply....It's coming up with an error:
stack "Invoice Register": execution error at line 6 (Function: error in function handler) near "revOpenDabase", char 7
Any ideas?.
Thx,
John
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
Typoes happen - line 6 should read
Jan Schenkel.
Code: Select all
put revOpenDatabase("sqlite", tDbPath, , , , ) into gConnectionId
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
-
- Posts: 3
- Joined: Wed May 13, 2009 4:54 pm
on Pre?
Hi Jan,
Thx...I should've posted that, much appreciated.
John
Thx...I should've posted that, much appreciated.
John