Problem with SQLite - need help
Posted: Wed Oct 03, 2007 9:21 am
I will learn more SQLite and understand the handling and more.
But if I was running the following code, the file "testDB" ist created, but it's empty.
And the SQLite Data Browser says: "..not a SQLite DataBase"
I don't know, what happens.
The code and the include are postings from here.
Is there a bug? Or is the code wrong? Or is my lib an old one (3.1.3)
Hope an Mac user can help.
But if I was running the following code, the file "testDB" ist created, but it's empty.
And the SQLite Data Browser says: "..not a SQLite DataBase"
Code: Select all
EnableExplicit
XIncludeFile "SQLite3_Include.pbi"
Define.l hDB, r, i, sqlhdl
Define.SQ3_TABLEMAP Table
If SQLiteInit() = 0
MessageRequester("Error", "Couldn't init SQLite3 lib") : End
EndIf
;
; Debug SQLiteLibVersion() ; 3.1.3
;
hDB = SQLiteOpen("testDB.db")
If Not hDB
MessageRequester("Error", SQliteErrorMsg(hDB)) : End
EndIf
If SQliteExecute(hDB, "CREATE TABLE testtable (spalte1 TEXT, spalte2 TEXT, spalte3 TEXT)") = #FALSE
Debug SQliteErrorMsg(hDB)
Else
For r = 1 To 5
If SQliteExecute(hDB, "INSERT INTO testtable (spalte1, spalte2, spalte3) VALUES ('r" + Str(r) + "c1', 'r" + Str(r) + "c2', 'r" + Str(r) + "c3')") = #FALSE
Debug SQliteErrorMsg(hDB)
EndIf
Next
EndIf
SQLiteClose(hDB)
SQLiteEnd()The code and the include are postings from here.
Is there a bug? Or is the code wrong? Or is my lib an old one (3.1.3)
Hope an Mac user can help.