Strange SQLite behaviour

IoSonoPiero

Active Member
Licensed User
Longtime User
Issue deleting data from SQLite table

Hello eveybody,
I've noticed that if I fill a database table, delete it and fill it again, in the database I find 2 copies of the same data.
If I delete and fill again the same table, I'll find 3 copies of the data and so on.

It's only my issue?

To fill the database I use
-----------
' Start transaction
Connection.BeginTransaction

For i = 0 To alWords.Count-1
strQuery = "INSERT INTO tablename (ID, Item, Item) VALUES (null, '" & alWords.Item(i) & "', 1)"
Command.CommandText = strQuery
Command.ExecuteNonQuery
Next i

' End transaction
Connection.EndTransaction
-----------

To clear the tale I use:
-----------
' Start transaction
Connection.BeginTransaction

Command.CommandText = "DELETE FROM tablename"
Command.ExecuteNonQuery

' End transaction
Connection.EndTransaction
-----------

WHY the items in the table are not deleted?
I'm locked here from 2 hours without a solution!

If I close and reopen the application, all data is deleted!

Someone can help me, please?

Thanks,
bye,
Piero
 
Last edited:

IoSonoPiero

Active Member
Licensed User
Longtime User
tablename, item and item are dummy names to replace with correct names

I've solved using array, I'll post a sample source with the issue
 
Top