Hi,
The following code generates an error and I am not sure why. The error says syntax error in UPDATE statement. Anyone have any ideas? Your help will greatly appreciated.
Dim CONNECTION_STRI NG As String = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=\\87-08\shareddocs\U ser.mdb"
Dim access As New OleDbConnection
access = New OleDbConnection (CONNECTION_STR ING)
Dim UpdateCommand As OleDbCommand = New OleDbCommand()
UpdateCommand.C onnection = access
UpdateCommand.C ommandText = "Update Admin Set [AcadYr] = @Ay, [ComName] = @Cn, [Sal1] = @Sa1, [Sal2] = @Sa2, [Firstname1] = @Fn1, [Firstname2] = @Fn2, [Lastname1] = @Ln1, [Lastname2] = @Ln2, [Status1] = @s1, [Status2] = @s2, [Designation1] = @Dg1, [Designation2] = @Dg2, [Add1] = @Add1, [Pcode] = @Pc, [Otel] = @Ot, [Dline1] = @D1, [Dline2] = @D2, [Faxno] = @Fn, [Email1] = @Em1, [Email2] = @Em2, [Supervisor1] = @Sp1, [Supervisor2] = @Sp2, [ProjId] = @Pi, [ProjTitle] = @Pt, [ProjCatDes] = @Pcd, [ProjCatCode] = @Pcc, [TechAreaDes] = @Tad, [Remarks] = @Rem, [Awards] =@Aw, [PDonation] =@PDon, [Year] =@Year, [TPrizes] =@Tz, [Time] =@Tim WHERE Id = @Id"
UpdateCommand.P arameters.AddWi thValue("@Id", IdComboBox.Text )
UpdateCommand.P arameters.AddWi thValue("@Ay", AcadYrComboBox. Text)
UpdateCommand.P arameters.AddWi thValue("@Cn", TextBox32.Text)
UpdateCommand.P arameters.AddWi thValue("@Sa1", ComboBox26.Text )
UpdateCommand.P arameters.AddWi thValue("@Sa2", ComboBox25.Text )
UpdateCommand.P arameters.AddWi thValue("@Fn1", TextBox27.Text)
UpdateCommand.P arameters.AddWi thValue("@Fn2", TextBox22.Text)
UpdateCommand.P arameters.AddWi thValue("@Ln1", TextBox29.Text)
UpdateCommand.P arameters.AddWi thValue("@Ln2", TextBox24.Text)
UpdateCommand.P arameters.AddWi thValue("@S1", ComboBox31.Text )
UpdateCommand.P arameters.AddWi thValue("@S2", ComboBox32.Text )
UpdateCommand.P arameters.AddWi thValue("@Dg1", TextBox28.Text)
UpdateCommand.P arameters.AddWi thValue("@Dg2", TextBox23.Text)
UpdateCommand.P arameters.AddWi thValue("@Add1" , TextBox33.Text)
UpdateCommand.P arameters.AddWi thValue("@Pc", TextBox34.Text)
UpdateCommand.P arameters.AddWi thValue("@Ot", TextBox35.Text)
UpdateCommand.P arameters.AddWi thValue("@D1", TextBox30.Text)
UpdateCommand.P arameters.AddWi thValue("@D2", TextBox25.Text)
UpdateCommand.P arameters.AddWi thValue("@Fn", TextBox36.Text)
UpdateCommand.P arameters.AddWi thValue("@Em1", TextBox31.Text)
UpdateCommand.P arameters.AddWi thValue("@Em2", TextBox26.Text)
UpdateCommand.P arameters.AddWi thValue("@Sp1", ComboBox23.Text )
UpdateCommand.P arameters.AddWi thValue("@Sp2", ComboBox22.Text )
UpdateCommand.P arameters.AddWi thValue("@Pi", ComboBox21.Text )
UpdateCommand.P arameters.AddWi thValue("@Pt", TextBox1.Text)
UpdateCommand.P arameters.AddWi thValue("@Pcd", ComboBox18.Text )
UpdateCommand.P arameters.AddWi thValue("@Pcc", ComboBox19.Text )
UpdateCommand.P arameters.AddWi thValue("@Tad", ComboBox20.Text )
UpdateCommand.P arameters.AddWi thValue("@Rem", TextBox19.Text)
UpdateCommand.P arameters.AddWi thValue("@Aw", ComboBox17.Text )
UpdateCommand.P arameters.AddWi thValue("@Id", IdComboBox.Text )
UpdateCommand.P arameters.AddWi thValue("@PDon" , ComboBox30.Text )
UpdateCommand.P arameters.AddWi thValue("@Year" , ComboBox33.Text )
UpdateCommand.P arameters.AddWi thValue("@Tz", ComboBox24.Text )
UpdateCommand.P arameters.AddWi thValue("@Tim", Time.Text)
access.Open()
UpdateCommand.E xecuteNonQuery( ) [COLOR="Red"]<== Error Here[/COLOR]
access.Close()