Hi I have this little problem here where I try to modify some infos from my database trough a form but it just wont update. Here is the code that I have right now
And when I put a breakpoint here is what I get for the Query Variable :
UPDATE Assettest Set Building AS '250', Rm AS '1011' WHERE NDecal ='N0317168'"
VB.NET:
Private Sub btnModifyAssetInfo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnModifyAssetInfo.Click
Dim conn As OleDbConnection
Dim cmd As OleDbCommand
Dim Asset As String
Dim Query As String
Dim AssetBuilding As String
Asset = frmAssetSearch.AssetNo
AssetBuilding = txtBuilding.Text
Query = "UPDATE Assettest Set Building AS '" + txtBuilding.Text + "', Rm AS '" + txtRoom.Text + "' WHERE NDecal ='" + Asset + "'"
gbInfos.Text = "Asset No : " + Asset
conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=N:\IT Equipment Asset Management.mdb")
cmd = New OleDbCommand(Query, conn)
conn.Close()
MsgBox("Asset updated successfully", MsgBoxStyle.Information, "Update")
End Sub
And when I put a breakpoint here is what I get for the Query Variable :
UPDATE Assettest Set Building AS '250', Rm AS '1011' WHERE NDecal ='N0317168'"