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?
Using SQLite3?
Re: Using SQLite3?
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.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?
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?
just typejassing wrote:my question is what do I need to get up and going with sqlite3 in purebasic4?
Code: Select all
UseSQLiteDatabase()
Greetings ... Kiffi
Hygge
- lazarusoft
- User
- Posts: 23
- Joined: Wed Jan 10, 2007 10:17 pm
- Location: Brasil
Re: Using SQLite3?
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
JAVA é como uma Ferrari, mas a diferença é que a Ferrari está em um caminhão cegonha... JAVA is like a Ferrari, but the difference is that Ferrari is in a truck stork ...