|
Post by metro on Aug 20, 2020 6:30:01 GMT -5
Found some time to get familiar with SQlite and lb5x32-351...I have some strange behavior which maybe a bug
simpledatabase.bas is sitting in............................ /home/user/lb5x32-351/lb5alpha-351/bas_files/
when run, Records.db is created here ........................../home/user/lb5x32-351/lb5alpha-351 one level up
This means that when the code is run again I get an error that states "table Payables already exists"
because...... files #accessor is not looking one level higher but somehow the program still knows it exists and throws the error..........and I get the message "Not here"
Am I doing something wrong?..
files #accessor, "Records.db" exists = #accessor hasAnswer() if exists = 1 then print "exists" if exists = 0 then print "Not here" if exists = 0 then call sqlExec "create table Payables (company char(50), invoice char(12), due integer, amt char(10))" print "Table Payables created." input "Press Enter to continue."; a$ end if
|
|
|
Post by Carl Gundel on Aug 20, 2020 10:44:54 GMT -5
Found some time to get familiar with SQlite and lb5x32-351...I have some strange behavior which maybe a bug
simpledatabase.bas is sitting in............................ /home/user/lb5x32-351/lb5alpha-351/bas_files/
when run, Records.db is created here ........................../home/user/lb5x32-351/lb5alpha-351 one level up
This means that when the code is run again I get an error that states "table Payables already exists"
because...... files #accessor is not looking one level higher but somehow the program still knows it exists and throws the error..........and I get the message "Not here"
Am I doing something wrong?.. No you aren't doing anything wrong. The sqliteconnect statement is not obeying the DefaultDir$, so I need to fix that. On the other hand DefaultDir$ isn't pointing at the bas_files folder. Perhaps you were thinking that it does? Perhaps I should also consider the user to set the default DefaultDir$ path in the settings. However you can specify the path for the database file in the sqliteconnect statement.
|
|
|
Post by metro on Aug 20, 2020 18:48:45 GMT -5
On the other hand DefaultDir$ isn't pointing at the bas_files folder. Perhaps you were thinking that it does? However you can specify the path for the database file in the sqliteconnect statement. yes, I was thinking DefaultDir$ points to bas_files folder because when I place "print DefaultDir$" as the first line in the program I get........ unlike RunBasic we get a separator at the end of the path
|
|
|
Post by Carl Gundel on Aug 21, 2020 9:00:12 GMT -5
On the other hand DefaultDir$ isn't pointing at the bas_files folder. Perhaps you were thinking that it does? However you can specify the path for the database file in the sqliteconnect statement. yes, I was thinking DefaultDir$ points to bas_files folder because when I place "print DefaultDir$" as the first line in the program I get........ unlike RunBasic we get a separator at the end of the path
I'll have to try that on Linux. When I tested it on Windows it didn't include the bas_files folder in the result. The truth is in the code.
|
|