Ubuntu FreeBasic & SQLite3

Linux specific questions.
Post Reply
Mike Green9
Posts: 17
Joined: Jan 05, 2021 20:43
Location: 1000 Islands, Ontario, Canada

Ubuntu FreeBasic & SQLite3

Post by Mike Green9 »

Hi.
I'm running FreeBasic 1.07 on Ubuntu 20.04

I want to be able to access sqlite3 databases.

Questions:

1. I installed sqlite3, but when I request the version number, I get:

sqlite3 -version
-- Loading resources from /home/mg/.sqliterc
Error: near line 4: near "*": syntax error
3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1

What to do here?

2. What FreeBasic command would I use to establish an sqlite connection with a database?

Thanks,
M....
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Ubuntu FreeBasic & SQLite3

Post by Imortis »

This is the version number.
Mike Green9 wrote: 3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1
Not sure what is up with the error, but if you look up running the command for version, it shows a message just like the one above.
badidea
Posts: 2586
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: Ubuntu FreeBasic & SQLite3

Post by badidea »

Mike Green9 wrote: 1. I installed sqlite3, but when I request the version number, I get:

sqlite3 -version
-- Loading resources from /home/mg/.sqliterc
Error: near line 4: near "*": syntax error
3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1

What to do here?
I have no experience with sqlite, but what is at line 4 in your .sqliterc? Did you check? (note: hidden file)
From what I read here (https://stackoverflow.com/questions/417 ... m-sqliterc), you could try to rename .sqliterc.
At my system with sqlite 3.22.0 installed, I do not have a .sqliterc file.
Mike Green9 wrote: 2. What FreeBasic command would I use to establish an sqlite connection with a database?
Did you check the example shipped with freebasic: https://github.com/freebasic/fbc/blob/m ... 3_test.bas
Mike Green9
Posts: 17
Joined: Jan 05, 2021 20:43
Location: 1000 Islands, Ontario, Canada

Re: Ubuntu FreeBasic & SQLite3

Post by Mike Green9 »

Re sqlite3 -version giving an error.
Silly mistake on my part. I added a comment line to /home/mg/.sqliterc with a leading * instead if /*.
My bad.

Re sqlite3 & FreeBasic
I'm looking into the example shipped with freebasic: https://github.com/freebasic/fbc/blob/m ... 3_test.bas.
GREAT help!


Thanks,
M...
Post Reply