Hi all
With the following SQL " Dim Query As String = "UPDATE JobName_tbl SET [JobDate]=@NewDATE, JobAddress=@Newaddress Where JobID=@ID"
nothing happens nothing gets updated nor do I get an error.
But as soon as I remove the [JobDate]=@NewDATE, it works fine.
Hope someone can help me with this situation.
Here is my code:
Thank You
Public Sub UpdateAddress(ByVal JobID As Integer, ByVal JobUpdate As String, ByVal NewDate As Date)
Try
Dim Query As String = "UPDATE JobName_tbl SET [JobDate]=@NewDATE, JobAddress=@Newaddress Where JobID=@ID"
Dim DBcon As New DBConnection.Connection
DBcon.FilePath = "C:\CFI\Filepath.txt"
DBcon.connect()
DBcon.con.Open()
Dim cmd As New OleDb.OleDbCommand(Query, DBcon.con)
With cmd
.CommandType = CommandType.Text
.CommandText = Query
.Parameters.AddWithValue("@Newaddress", JobUpdate)
.Parameters.AddWithValue("@ID", JobID)
.Parameters.AddWithValue("@NewDATE", NewDate)
.ExecuteNonQuery()
End With
DBcon.con.Close()
Catch ex As Exception
MsgBox("JobAddress_UpdateAddress" & ex.Message)
End Try
End Sub