📄 tapi.bas
字号:
Attribute VB_Name = "TAPI"
Public Type DCB
DCBlength As Long
BaudRate As Long
fBitFields As Long 'See Comments in Win32API.Txt
wReserved As Integer
XonLim As Integer
XoffLim As Integer
ByteSize As Byte
PARITY As Byte
StopBits As Byte
XonChar As Byte
XoffChar As Byte
ErrorChar As Byte
EofChar As Byte
EvtChar As Byte
wReserved1 As Integer 'Reserved; Do Not Use
End Type
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Public PARITY(4) As String
Public Declare Function ReleaseCapture Lib "user32" () As Long
Public adoCn As New Connection
Public adoSet As New Recordset
Public Const WM_SETREDRAW = 11
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const HWND_TOPMOST = -1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Sub GetRecordSet(sqlText As String, priSet As Recordset, Optional MaxRecords As Integer, Optional adType As CommandTypeEnum = adCmdText, Optional adParm As LockTypeEnum = adLockReadOnly)
If priSet Is Nothing Then Set priSet = New Recordset
If priSet.State = adStateOpen Then priSet.Close
priSet.MaxRecords = MaxRecords
On Error Resume Next
priSet.Open sqlText, adoCn, adOpenForwardOnly, adParm, adType
If Err.Number Then
Debug.Print sqlText
Debug.Print Err.Description
End If
End Sub
Sub WriteCID(dTime As String, id As String)
On Error Resume Next
'adoCn.Execute "INSERT INTO IDList VALUES('" & dTime & "','" & id & "')", , adCmdText
'Exit Sub
If adoCn.State = 0 Then Exit Sub
GetRecordSet "IDList", adoSet, , adCmdTable, adLockOptimistic
adoSet.AddNew
adoSet(0) = dTime
adoSet(1) = id
adoSet.Update
End Sub
Public Sub InitParity()
PARITY(0) = "E"
PARITY(1) = "M"
PARITY(2) = "N"
PARITY(3) = "O"
PARITY(4) = "S"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -