hello
i have to update records in ms-access
it is not working
the error is : syntax error in update statement
Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
GroupBox1.Visible = False
Dim strupdate As String
co = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\varsha2011\plotdetails\plotdetails\harvesting.mdb;")
strupdate = "UPDATE harvesting SET date1=#" & DateTimePicker1.Value & "#, plotno=" & CInt(txtplot.Text) & ", pruning=#" & DateTimePicker2.Value & "#, start=#" & DateTimePicker3.Value & "#, hi=" & CInt(txthi.Text) & ", end=#" & DateTimePicker4.Value & "#, hi1=" & CInt(txthi1.Text) & ", duration=" & CInt(txtduration.Text) & ", uk=" & CInt(txtuk.Text) & ", holland=" & CInt(txtholland.Text) & ", gulf=" & CInt(txtgulf.Text) & ", maleysia=" & CInt(txtmalaysia.Text) & ", local=" & CInt(txtlocal.Text) & ", bedana=" & CInt(txtbedana.Text) & ", total=" & CInt(txttotal.Text) & " WHERE fileno=" & txtse.Text & ";"
MsgBox(strupdate)
cm = New OleDbCommand(strupdate, co)
cpen()
cm.ExecuteNonQuery()
MessageBox.Show("updates successfully", "update", MessageBoxButtons.OK)
co.Close()
End Sub
i have to update records in ms-access
it is not working
the error is : syntax error in update statement
Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
GroupBox1.Visible = False
Dim strupdate As String
co = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\varsha2011\plotdetails\plotdetails\harvesting.mdb;")
strupdate = "UPDATE harvesting SET date1=#" & DateTimePicker1.Value & "#, plotno=" & CInt(txtplot.Text) & ", pruning=#" & DateTimePicker2.Value & "#, start=#" & DateTimePicker3.Value & "#, hi=" & CInt(txthi.Text) & ", end=#" & DateTimePicker4.Value & "#, hi1=" & CInt(txthi1.Text) & ", duration=" & CInt(txtduration.Text) & ", uk=" & CInt(txtuk.Text) & ", holland=" & CInt(txtholland.Text) & ", gulf=" & CInt(txtgulf.Text) & ", maleysia=" & CInt(txtmalaysia.Text) & ", local=" & CInt(txtlocal.Text) & ", bedana=" & CInt(txtbedana.Text) & ", total=" & CInt(txttotal.Text) & " WHERE fileno=" & txtse.Text & ";"
MsgBox(strupdate)
cm = New OleDbCommand(strupdate, co)
cpen()
cm.ExecuteNonQuery()
MessageBox.Show("updates successfully", "update", MessageBoxButtons.OK)
co.Close()
End Sub