读书人

关于数据库数据更新的有关问题

发布时间: 2011-12-31 23:50:30 作者: rapoo

关于数据库数据更新的问题
想做个数据库更新按钮,请高手指点:

VB code
Private Sub Command_UPDATA_Click()Dim myval As StringIf 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 IfEnd IfEnd Sub


[解决办法]
你的代码有什么问题吗?

读书人网 >VB

热点推荐