Dynamically created SQLite Database behaving strangely

rbw152

Member
Licensed User
Longtime User
Hi

we're using the SQL library and Connection.CreateSQLTable to create a SQLite database and tables dynamically at runtime - this works fine.

However, when we use database administration software of any kind to edit the database contents something very strange happens. If we change the value of one field for one record in the main table all records in the table for that field are changed to the same value!

Why is this? If we do the same thing with a database created manually it all works as expected but the dynamically created one seems to run an update query across the entire column instead of just changing the value of the row/field in question.

Any ideas? Are we doing something wrong when we create the database using the Connection object?
 

rbw152

Member
Licensed User
Longtime User
Sure, here's the code and I've attached the resulting database too:

FileOpen(c1,AppPath & "\localdata.csv",cWrite)
FileWrite (c1,tmpString)
FileClose(c1)


'Create Table
tblData.LoadCSV ("localdata.csv", "|", True, True)
tblData.AddCol(cString,"Edited",25)
tblData.AddCol(cString,"Uploaded",25)


'Reproduce Table as SQLite database


'First delete the existing table if it exists
Command.CommandText = "DROP TABLE IF EXISTS assets"
Command.ExecuteNonQuery


'Create database table from table object
Connection.CreateSQLTable ("tblData","assets")
 

Attachments

  • offlinedata.zip
    68.8 KB · Views: 355

fatman

Active Member
Licensed User
Longtime User
Hi rbw 125,

downloaded your sqlite-file.
I had no problem editing the records with the firefox extension "sqlite manager". Checked the results with the sqlite plugin of total-commander: all changes i made to your table were correct. No faults whatsoever.

Think you must check the software you are using handling your sqlite tables.

Fatman
 
Top