【正文】
meric() Or Val() = 0 Then 39。運(yùn)行時(shí)如果用戶點(diǎn)擊的是 MsgBox提示框的“確定”按鈕,返回值是 1 Dim conn As New Dim rs As New Dim Str1 As String Dim Str2 As String Dim Str3 As String Str1 = Provider=。 Str3 strSQL = select * from Access_db where 編號(hào) = amp。因此以編號(hào)字段的內(nèi)容作為判斷的依據(jù) 39。刷新數(shù)據(jù)源, MSHFlexGrid 控件會(huì)實(shí)時(shí)刷新顯示數(shù)據(jù) Else MsgBox (不存在此記錄! ) = = = = Exit Sub End If End If 39。運(yùn)行時(shí)如果用戶點(diǎn)擊的是 MsgBox提示框的“確定”按鈕,返回值是 1 Dim conn As New Dim rs As New Dim Str1 As String Dim Str2 As String Dim Str3 As String Str1 = Provider=。 Str3 strSQL = select * from Access_db where 編號(hào) = amp。因此以編號(hào)字段的內(nèi)容作為判斷的依據(jù) 39。以下四條語句的作用是在操作完成后將文本框置空 = = = = End Sub Private Sub Command4_Click() Dim sc As Integer sc = MsgBox(確實(shí)要退出系統(tǒng)嗎? , vbOKCancel, 提示信息 ) If sc = 1 Then 39。否則給“不存在此記錄”的提示信息并關(guān)閉數(shù)據(jù)連接 MsgBox (刪除記錄成功! ) 39。 strSQL, conn, 3, 3 If rs!編號(hào) = Val() Then 39。 Str3 = Jet OLEDB:Database Password= Str1 amp。編號(hào)字段是 Access 的自動(dòng)編號(hào),為自然數(shù) 39。才會(huì)修改其它三個(gè)字段的內(nèi)容 39。 strSQL, conn, 3, 3 If rs!編號(hào) = Val() Then 39。 Str3 = Jet OLEDB:Database Password= Str1 amp。因此對(duì) text4 的內(nèi)容進(jìn)行校驗(yàn),如果不是數(shù)值或?yàn)?0 則跳出 sub 過程 MsgBox 記錄號(hào)是大于 0 的自然數(shù),請(qǐng)輸入正確的編號(hào)! Exit Sub End If If = Or = Or = Then 39。 Str3 strSQL = select * from Access_db strSQL, conn, 3, 3 rs(網(wǎng)站名稱 ) = rs(網(wǎng)站地址 ) = rs(網(wǎng)站描述 ) = MsgBox (添加記錄成功! ) 39。運(yùn)行時(shí)如果用戶點(diǎn)擊的是 MsgBox提示框的“確定”按鈕,返回值是 1 Dim conn As New Dim rs As New Dim Str1 As String Dim Str2 As String Dim Str3 As String Str1 = Provider=。運(yùn)行時(shí)如果用戶點(diǎn)擊的是 MsgBox 提示框的 “ 確定 ” 按鈕,返回值是 1 End End If End Sub 六、添加完事件代碼之后,我們這個(gè)實(shí)例至此完成,運(yùn)行一下吧! Private Sub Form_Load() (0) = 600 (1) = 1000 (2) = 2300 (3) = 4000 = = = = End Sub Private Sub Command1_Click() Dim sc As Integer If = Or = Or