syntax error in update statement (1 Viewer)

varshasan

New member
Local time
Today, 07:36
Joined
Mar 11, 2011
Messages
4
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)

co_Open()
cm.ExecuteNonQuery()

MessageBox.Show(
"updates successfully", "update", MessageBoxButtons.OK)
co.Close()
End Sub
 

varshasan

New member
Local time
Today, 07:36
Joined
Mar 11, 2011
Messages
4
i have faced same problem in another query
i made the changes you have given in previous reply and it worked
thank you very much
 

Users who are viewing this thread

Top Bottom