I tried following examples. my code is below:
Dim $con As New Connection
Try $con.Close()
$con.Type = "sqlite3"
$con.host = "./"
$con.name = "Invoices.db"
$con.Open
I get the message "Unable to locate database 'invoices.db' in ./"
I have the database file in the directory where the program resides.
What am i doing wrong? Any help is appreciated.
Thanks
slqite3 issue
- BruceSteers
- Posts: 1790
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: slqite3 issue
did you try an absolute path?
$con.host = Application.Path
I'd use the ./ path only for reading files, for writing (or other uses, i guess db) then i'd use Application.Path
$con.host = Application.Path
I'd use the ./ path only for reading files, for writing (or other uses, i guess db) then i'd use Application.Path
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: slqite3 issue
Two notes:
1) You CANNOT write to a database inside the executable(nor any other file inside the executable.) The database must exist outside the executable.
2) As Bruce says you must use a FULL path to the sqlite file. Read up up on how Gambas uses relative paths.
b
1) You CANNOT write to a database inside the executable(nor any other file inside the executable.) The database must exist outside the executable.
2) As Bruce says you must use a FULL path to the sqlite file. Read up up on how Gambas uses relative paths.
b