Page 1 of 1
Using SQLite3?
Posted: Wed Mar 03, 2010 2:36 pm
by jassing
I tried to use PBOSL4 to use sqlite3, but that didn't work, and was unable to recompile (tailbite errors).
I see others are using sqlite3 -- my question is what do I need to get up and going with sqlite3 in purebasic4?
Re: Using SQLite3?
Posted: Wed Mar 03, 2010 2:46 pm
by bobobo
try to read the purebasic online help -section database

Re: Using SQLite3?
Posted: Wed Mar 03, 2010 3:09 pm
by rsts
jassing wrote:I tried to use PBOSL4 to use sqlite3, but that didn't work, and was unable to recompile (tailbite errors).
I see others are using sqlite3 -- my question is what do I need to get up and going with sqlite3 in purebasic4?
There are some excellent wrappers for sqlite3, if you're willing to go that route. Many of us have been doing it that way for a number of years and feel it's very solid.
Use a search - ts-soft has privided an excellent wrapper. There is quite a bit of forum support avainable for this approach also. Fangbeast could write a tutorial.
cheers
Re: Using SQLite3?
Posted: Wed Mar 03, 2010 10:03 pm
by Kiffi
jassing wrote:my question is what do I need to get up and going with sqlite3 in purebasic4?
just type
that's all!
Greetings ... Kiffi
Re: Using SQLite3?
Posted: Sun Mar 07, 2010 10:23 pm
by lazarusoft
Native PB, it's easy
Code: Select all
UseSQLiteDatabase()
ImportC ""
sqlite3_libversion()
EndImport
Debug "Sqlite3 Version: "+PeekS(sqlite3_libversion()) ; Sqlite3 Version: 3.6.23.1
Filename$ = "C:\mydb.db3"
If CreateFile(0, Filename$)
Debug "Database file created OK"
CloseFile(0)
EndIf
If OpenDatabase(0, Filename$, "", "")
Debug "Connected to mydb.db3 OK"
Define.s msg="blabla"
If DatabaseUpdate(0, "CREATE TABLE info (test VARCHAR(255));")
Debug "Table created OK"
DatabaseUpdate(0, "INSERT INTO info (test) values ('"+msg+"');")
DatabaseQuery(0, "SELECT * FROM info")
;Debug DatabaseError()
If FirstDatabaseRow(0)
Debug GetDatabaseString(0,0); get blabla
FinishDatabaseQuery(0)
EndIf
EndIf
CloseDatabase(0); close database
EndIf