syntax error in update statement (1 Viewer)

varshasan

New member
Local time
Yesterday, 22:01
Joined
Mar 11, 2011
Messages
4
i have used ms access as backend
i have error in updating the record
the error as syntax error in update statement.the code i have written is as follows

Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
GroupBox1.Visible =
False
Dim strupdate As String
co = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\varsha2011\plotdetails\plotdetails\plot.mdb;")
strupdate =
"UPDATE plot SET [group]='" & txtgroup.Text & "' ,plotno=" & CInt(txtplot.Text) & ", area='" & txtarea.Text & "' ,variety='" & txtvariety.Text & "',farmername='" & txtname.Text & "',dist bet rows=" & CInt(txtrow.Text) & ",area per plant=" & CInt(txtplant.Text) & ",dist bet plants=" & CInt(txtperplant.Text) & ",no of per plant cost=" & CInt(txtnoplant.Text) & ",area plot acre=" & CInt(txtareacre.Text) & ",canopy syatem='" & txtcanopy.Text & "' ,date of forwardpruning=#" & DateTimePicker1.Value & "# ,stage=" & CInt(txtstage.Text) & " ,no of canes required=" & CInt(txtcanesreq.Text) & ",no of canes actual=" & CInt(txtcanesactual.Text) & ",no of sprout=" & CInt(txtsprout.Text) & ",no of bunch required=" & CInt(txtbunch.Text) & ",no of bunch actual=" & CInt(txtbunchactual.Text) & ",no of leaves=" & CInt(txtleaves.Text) & ",avg length of leaves=" & CInt(txtlen.Text) & ",avg breadth=" & CInt(txtbreadth.Text) & ",area per plant=" & CInt(txtareaperplant.Text) & ",date of backward pruning=#" & DateTimePicker1.Value & "#,no of canes=" & CInt(txtcanesbackward.Text) & ",no of canes sq ft=" & CInt(txtcanessqft.Text) & ",thickness of canes=" & CInt(txtthickness.Text) & ",area of leaf=" & CInt(txtarealeaf.Text) & ",leaf index=" & CInt(txtleafindex.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()
 

MarkK

bit cruncher
Local time
Yesterday, 22:01
Joined
Mar 17, 2004
Messages
8,181
Field names with spaces need to be enclosed in square brackets.
Code:
...", [no of canes required] = " & CInt(txtcanesreq.Text)...
 

secureteam

New member
Local time
Today, 10:31
Joined
Oct 17, 2011
Messages
1
The assemblies in .NET can be broadly classified in two categories metadata and intermediate language code.
 

Users who are viewing this thread

Top Bottom