__Option Explicit '强制变量在使用前必须定义
Dim objCn As Connection, objRs As Recordset
Dim isAdding As Boolean '用于保存是否处于添加记录状态
Private Sub cmdAdd_Click()
isAdding = True
fraChangeRecord.Enabled = False
fraAnswer.Enabled = True
cmdEdit.Enabled = False
cmdAdd.Enabled = False
cmdSave.Enabled = True
txtContent.Locked = False
txtContent = ""
txtNews = "增加新题……"
End Sub
Private Sub cmdDelete_Click()
On Error GoTo DealError
If isAdding Then
'撤销添加记录操作,显示当前记录
isAdding = False
fraChangeRecord.Enabled = True
cmdEdit.Enabled = True
cmdDelete.Enabled = True
cmdAdd.Enabled = True
cmdSave.Enabled = False
fraAnswer.Enabled = False
txtContent.Locked = True
ShowCurrentRecord
Exit Sub
End If
If objRs.RecordCount <= 0 Then Exit Sub
If MsgBox("确认删除当前试题吗?", vbQuestion + vbYesNo) = vbYes Then
objRs.Delete
objRs.Update
objRs.MoveNext
If objRs.EOF And objRs.RecordCount > 0 Then objRs.MoveLast
ShowCurrentRecord
End If
Exit Sub
DealError:
MsgBox "程序执行出错,错误信息如下:" & vbCrLf & Err.Description
End Sub
Private Sub cmdEdit_Click()
If objRs.RecordCount <= 0 Then Exit Sub
fraChangeRecord.Enabled = False
fraEditPic.Enabled = True
cmdEdit.Enabled = False
cmdDelete.Enabled = False
cmdAdd.Enabled = False
cmdSave.Enabled = True
fraAnswer.Enabled = True
txtContent.Locked = False
txtNews = "修改本题……"
End Sub
Private Sub cmdExit_Click()
Unload Me '关闭窗体
End Sub
Private Sub cmdMoveFirst_Click() '使第1条记录成为当前记录
If objRs.RecordCount > 0 Then
objRs.MoveFirst
ShowCurrentRecord
End If
End Sub
Private Sub cmdMovePre_Click() '使前一条记录成为当前记录
If objRs.RecordCount > 0 Then
objRs.MovePrevious
If objRs.BOF Then objRs.MoveFirst
ShowCurrentRecord
End If
End Sub
Private Sub cmdMoveNext_Click() '使下一条记录成为当前记录
If objRs.RecordCount > 0 Then
objRs.MoveNext
If objRs.EOF Then objRs.MoveLast
ShowCurrentRecord
End If
End Sub
Private Sub cmdMoveLast_Click() '使最后一条记录成为当前记录
If objRs.RecordCount > 0 Then
objRs.MoveLast
ShowCurrentRecord
End If
End Sub
有人能帮我把这段VB代码翻译成汉字吗(入门级的)??谢谢!!急切
move……的是移动记录集中的记录到指定行 ,然后显示改记录行的信息
常用的组态软件有哪些?
11、NI Lookout NI Lookout是市场上最为易用的工控组态软件,运用Lookout,可以很方便地实现对工业过程的监控和数据采集。Lookout支持数十种PLC的通信协议,比如Modbus,AB和Siemens等。Lookout同样支持OPC通信。Lookout还可以同NI的硬件产品FieldPoint无缝集成。
常用的组态软件都有哪些 分别是那些公司的
链接:https:\/\/pan.baidu.com\/s\/1Og6JQIAUrRHN3F8tmxHirg 提取码:zcsj InTouch HMI软件用于可视化和控制工业生产过程。它为工程师提供了一种易用的开发环境和广泛的功能,使工程师能够快速地建立、测试和部署强大的连接和传递实时信息的自动化应用。InTouch软件是一个开放的、可扩展的人机界面,为定...