Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15564

[RESOLVED] SQL Not Updating

$
0
0
I have a problem with a table not updating.

Background...
At first I was running two separate DB3's
I read/wrote to each one separately perfectly fine.
Each DB had its own conn, which I close after each use

I imported (CSV) one table to the 1st DB. Same table name, fields etc
Same code, except the path to 2nd DB was changed to path of 1st DB

But now, when I try to update the to the added table, it doesn't update.
I get no errors of any kind.
Debugged, and the sql string I am passing is perfectly fine.

Code:

"UPDATE accountsmms SET id='1',Date='06-07-2020',Account='AllocatedinCHK',Type='Income',Category='Expense',Item='Misc Cash',Budget = '0.00',Balance='0.00' WHERE id=1"
Here is my updating code:

Code:

Dim filePath = lbStatus.Text
Using connection As New SQLite.SQLiteConnection("Data Source=" & filePath & "")
    Dim cmd As New SQLiteCommand(sql, connection)
    cmd.Connection = connection
    cmd.CommandType = CommandType.Text
    cmd.CommandText = sql
    connection.Open()
    cmd.ExecuteNonQuery()
    cmd.Dispose()
    connection.Close()
End Using

It may be that the DB is still opened, but I am sure I close it when loading it with....
Code:

connection.Close()
da.Dispose()

How can I make sure the DB is closed completely??
Or is something else wrong?

Thanks

Viewing all articles
Browse latest Browse all 15564

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>