1,217
社区成员




Private Sub Timer1_Timer() '设定1秒周期
If Working = True Then
WorkStart
End If
End If
Private Sub WorkStart()
If TSOK = True And Createok = False Then
Create_Code
ElseIf TSOK = True And Createok = True And DisplayOK= False Then
DisplayCode
ElseIf TSOK=True and Createok=True And DisplayOK=True And WriteOK=False Then
WriteCode
End If
End Sub
Private Sub Create_Code()
'此段代码为SQL语句执行完记录表插入记录,数据库为Access
‘ Conn.Execute InsertStr’
..........
..........
Createok =True
End Sub
Private Sub DisplayCode()
TEXT1.Text=“ABCDEFGHIJKLMNOPQ”
DisplayOK=True
End Sub
Private sub Create_Code()
Dim InsertStr As String
Dim ProductDateB As String
Dim ProductTimeB As String
Dim Empty_V As String
Empty_V = ""
PDateB = Format(Now, "yyyy/mm/dd")
PTimeB = Format(Now, "HH:MM:SS")
InsertStr = "Insert into Record ( 姓名,性别,籍贯,输入日期,输入时间,备注) Values ('" & AName& "','" & ASex& "','" & Ajiguan& "','" & PDateB & "','" & PTimeB & "','" & Empty_V & "')"
If Conn.State = 0 Then
DatabaseConnect
End If
Conn.Execute InsertStr
If Conn.State = 1 Then
DatabaseClose
End If
Create_Code=True
end Sub