1,217
社区成员




Private Sub cmdSave_Click()
Dim UpdateSql As String
Dim UpdateCommand As New ADODB.Command
On Error GoTo eNext:
UpdateSql = "update tabPowerRange set " + _
"RatedPower=" + Trim(txtRatedPower.Text) + "," + _
"Ratedv=" + Trim(txtRatedV.Text) + " where id=" & Trim(txtID.Text)
UpdateCommand.ActiveConnection = SqlConn
UpdateCommand.CommandType = adCmdText
UpdateCommand.CommandText = UpdateSql
UpdateCommand.Execute
Call frmMain.ReLoadData
MsgBox "Update Success...", vbInformation, App.Title
Unload Me
eNext:
MsgBox Err.Description, vbCritical, Err.Number
End Sub
Private mrdoCon As rdoConnection
Dim mRes As rdoResultset
Dim mSQL As String
Private Sub Command1_Click()
If txt1.Text = "" Or txt2.Text = "" Then
MsgBox "原因或类型不能为空!", vbCritical, "错误"
Else
mrdoCon.Execute "update test set [usern] = '" & txt1.text & "',password= '" & txt2.text & "' where RStyle='" & curRstyle & "'"
End If
End Sub