sqlite not deleting rows

Hi all.

I have an sqlite database, that I am writing to. This works no problem. But when I go to load my database when I open my program, It does not seem to delete all rows even when I have the deleteallrows command as shown below:


Dim siteRS as RecordSet


siteRS = DB.SqlSelect(sql)

if DBError then Return

'Get Each entry in the database and put it in the listbox

if siteRS <> NIL Then
while not siteRS.EOF
TimeManagementListboxbox.AddRow (siteRS.Field(“DATACUSTOMER”).StringValue, siteRS.Field(“DATADATE”).StringValue, siteRS.Field(“DATAHOURS”).StringValue, siteRS.Field(“DATAMINUTES”).StringValue, siteRS.Field(“DATASECONDS”).StringValue, siteRS.Field(“DATANOTES”).StringValue)

'save Password database Primary Key for adding and editing

'TimeManagementListboxbox.rowtagat(TimeManagementListboxbox.LastRowIndex) = siteRS.Field("ID").IntegerValue


end if[/code]

Any ideas?


There is no connection between the listbox & database so removing rows from the listbox will have no effect. You need to execute some SQL to do this.

Oh good it wasn’t just me… I too was confused as to where he was expecting rows to be deleted from

but if it is in fact from the LISTBOX, then the code is correct (however with R2.0/R2.1 and API2 no telling if it works properly still or not…)

And if you’re expecting the first line in your code to delete all rows from the table, why is you next step to query for all the rows in the table?

Hi Guys.

Found a resolution to my problem.

When I take the information in my listbox that I put into a SQLite Database, I delete the existing info in the .sqlite database and re-add. Maybe not the BEST way, but it does work.

Thanks for your time.