Code:Private Sub cmdUpdate_Click() Dim objConn1 As New ADODB.Connection Set objCmd = New ADODB.Command objConn1.Open "DSN=PRsystem" Set objCmd.ActiveConnection = objConn1 objCmd.CommandText = " UPDATE DataBase_T SET Description = ' " & txtD1.Text & " ' , Qty = ' " & txtQ1.Text & " ' , Unit_Cost = ' " & txtUC1.Text & " ' " & _ " WHERE Description = ' " & describe & " ' And Qty = ' " & qty1 & " ' And Unit_Cost = ' " & uc & " ' And PR_NO = ' " & Label15.Caption & " ' " objCmd.CommandType = adCmdText objCmd.Execute MsgBox " Data is updated." If Not objConn1 Is Nothing Then If objConn1.State Then objConn1.Close End If Set objConn1 = Nothing End If
the above seems to have no error...cuz the msgbox would appear ...however i check the databse..and it was not updated!!!?why?




Reply With Quote