关于数据库数据更新的有关问题
关于数据库数据更新的问题
想做个数据库更新按钮,请高手指点:
------解决方案--------------------
你的代码有什么问题吗?
想做个数据库更新按钮,请高手指点:
- VB code
Private Sub Command_UPDATA_Click() Dim myval As String If Text1.Text = "" Or Combo1.Text = "" Then MsgBox "Please input Material Number.And Device Process Type" Else Set rs = cn.Execute("select * from MaterialNo WHERE [MaterialNo]='" & Text1.Text & "'") If rs.EOF Then myval = MsgBox("Save New Material Number?", vbInformation + vbYesNoCancel, "Notice :") If myval = vbYes Then cn.Execute ("insert into MaterialNo values('" & Text1.Text & "','" & Combo1.Text & "')") MsgBox ("Add New Complete!") Adodc1.Refresh Call Command_Refresh_Click Else Text1.Text = "" End If Else Text1.Text = "" Combo1.Text = "" End If End If End Sub
------解决方案--------------------
你的代码有什么问题吗?