I have been trying to select one row from a db, then change a field in it.. and update the row in the db.
Here is my code:
what am I doing wrong? I get no errors.. and the db isnt updated.
Sorry for the dumb question.. but I have searched and search.. without an answer :/
/edit/
here is the answer:
Here is my code:
Code:
---edit----
what am I doing wrong? I get no errors.. and the db isnt updated.
Sorry for the dumb question.. but I have searched and search.. without an answer :/
/edit/
here is the answer:
Code:
Dim RefID As Integer = DirectCast(sender.Tag, String).ToString
Dim LookupAvail As String = DirectCast(sender.Text, String).ToString
Dim Avail() As String = LookupAvail.ToString.Split(" ")
Dim conn As OleDbConnection
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db.mdb;User Id=admin;Password=;"
conn = New OleDbConnection(connString)
conn.Open()
Dim MyCommand As New OleDbCommand("UPDATE x SET y = " & Avail(7) + 1 & " Where z = " & v & "", conn)
MyCommand.ExecuteNonQuery()
conn.Close()
MyCommand.Dispose()
Last edited by a moderator: