hiya
i am working on some software for PAT Testing, and its a simple app in the end it takes readings and save them to a database, access 2003.
ive over come all my problems apart from this one! and ive got a desk piled high with examples and book on this but im still stuck!
all i need to do is update a row with a year, eg the row C0001 was 2005, now it needs to be 2006.
here is my code:
Try
Dim DBConn As OleDbConnection
Dim dbCommand As New OleDbCommand()
DBConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/pat.mdb;")
dbCommand.CommandText = "Update data SET Where ident= " & TextBox2.Text & " year= " & TextBox1.Text
dbCommand.Connection = DBConn
dbCommand.Connection.Open()
dbCommand.ExecuteNonQuery()
DBConn.Close()
Catch err As System.Exception
MsgBox(err.Message)
End Try
now i know ive prob done something stupid, but im teaching this to myself so any help/pointers would be good.
thanks.
i am working on some software for PAT Testing, and its a simple app in the end it takes readings and save them to a database, access 2003.
ive over come all my problems apart from this one! and ive got a desk piled high with examples and book on this but im still stuck!
all i need to do is update a row with a year, eg the row C0001 was 2005, now it needs to be 2006.
here is my code:
Try
Dim DBConn As OleDbConnection
Dim dbCommand As New OleDbCommand()
DBConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/pat.mdb;")
dbCommand.CommandText = "Update data SET Where ident= " & TextBox2.Text & " year= " & TextBox1.Text
dbCommand.Connection = DBConn
dbCommand.Connection.Open()
dbCommand.ExecuteNonQuery()
DBConn.Close()
Catch err As System.Exception
MsgBox(err.Message)
End Try
now i know ive prob done something stupid, but im teaching this to myself so any help/pointers would be good.
thanks.