Jacksparrow87
Technical User
Hi people,
I was hoping someone could help me out here please, basically I have an application which is linked to a database.
Now if the combobox status is set to 'closed', I want to Update my database on EVERY row where the lognumber matches lbllogno.
So far I have the following coding:
Now when I run the above coding, it breaks on the cmd.ExecuteNonQuery() line.
Please help, thanks
I was hoping someone could help me out here please, basically I have an application which is linked to a database.
Now if the combobox status is set to 'closed', I want to Update my database on EVERY row where the lognumber matches lbllogno.
So far I have the following coding:
Code:
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" & Application.StartupPath & "\CNS.mdb")
Dim cmd As New OleDbCommand
With cmd
.CommandType = CommandType.Text
.Connection = conn
.CommandText = "UPDATE [Log] SET Status = Status " & Val(cmbstatus.Text) & " WHERE LogNumber = lbllogno.text"
.Parameters.Add("@p1", Me.cmbstatus.SelectedValue)
End With
conn.Open()
cmd.ExecuteNonQuery()
Now when I run the above coding, it breaks on the cmd.ExecuteNonQuery() line.
Please help, thanks