I am new to SQLite. I bought a book written by Eugene Dakin about SQLite with Xojo. Keeping myself almost to what was written in the book, I wrote my a piece to insert a row of data into my database:
Dim row as new DatabaseRecord
Dim db as SQLiteDatabase
[i]f = GetFolderItem(gPathDB+“DTS.sqlite”)
db = new SQLiteDatabase
db.DatabaseFile=f
if db.Connect = true then
cell()=split(Records,",")
row.Column("dDate")=cell(0)
row.Column("dTime")=cell(1)
row.Column("dTitle") =cell(2)
row.Column("dLat") =cell(3)
row.Column("dLon")=cell(4)
row.Column("dDepth")=cell(5)
row.Column("dForce")=cell(6)
row.Column("dType")=cell(7)
row.Column("dDesc")=cell(8)
row.Column("dName")=cell(9)
row.Column("dMove")=cell(10)
row.Column("dPresure")=cell(11)
row.Column("dSpeed")= cell(12)
db.InsertRecord("Dist",row)
db.Commit
else
msgbox "Could not connect to database"+EndOfLine+db.ErrorMessage
end if[/i]
Dist a a file in the database containing the records as written in the row lines.
Xojo can connect to the database, because it does not pop/up the msgbox with the error. As soon as I change anything in the path or filename, the msgbox pops up.
I do not know if db.commit is valid here, the examples in the book does insert the record, but does not commit. There my database was not updated without the commit statement, I added that to the code.
Still, there is no update into my database.
Any SQLite knowledged person who can help me?
I tried even to use another SQLite command to update the database:
db.SQLExecute(“INSERT INTO Disaster (dDate,dTime,dTitle,dLatT,dLonT,dDepth,dForce,dType,dDesc,dName,dMove,dPresure,dSpeed) VALUES (cell(0).cell(1),cell(2),cell(3),cell(4),cell(5),cell(6).cell(7),cell(8),cell(9),cell(10),cell(11),cell(12)”)
…but same result…no update