Home > Software engineering >  Vb computer room management system login button clicks why two different results come out great god
Vb computer room management system login button clicks why two different results come out great god

Time:10-17


Text4 text5 shows the connection of the access corresponding time
Text6 text7 shows both time conversion into s
Click for the first time shows the current time conversion into s
The code below
 Dim flag As Integer 
Dim kouling As String
Dim xingming As String
Dim zhanghao As String
Dim banji As String
Dim h As Integer
Dim m As Integer
Dim s As Integer
Dim nh As Long
Dim nm As Long
Dim ns As Long
Dim nyear As Integer
Dim nmonth As Integer
Dim nday As Integer
Dim xingqi As String
Dim m1, m2, and m3 As Integer
Dim finalt As Long
Dim presentt As Long
Dim t As Long
Dim t1, t2 As String
Dim tnow t1n, t2n As Long
Dim jishu As Integer 'expressed in t1 t2 corresponding to the end of the week at the beginning of class time
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
X As Long
Y As Long
End Type
Dim leiji1, leiji2 As Long
Dim, wu qi As Integer
Private Sub Command1_Click ()
M1=0
M2=0
M3=0
'Dim m4 As Integer
'the m4=0
Flag=1
'-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- whether the student id password
Zhanghao=Text1. Text
Data1. RecordSource="select * from student information where student id='" & amp; Zhanghao & amp; "'
"Data1. Refresh
EOF Then If Data1. You.
MsgBox "without the student id!" , and "prompt"
Data1. RecordSource="student information"
Data1. Refresh
Flag=1
End the If
Kouling=Text2. Text
'to find the corresponding student id password
On the Error Resume Next
Data1. You. MoveFirst
Dim As Integer I
Dim que As String
For I=1 To Data1. You. RecordCount
If zhanghao=Data1. You. Fields (" student id ") Then
Que=Data1. You. Fields (" password ")
Xingming=Data1. You. Fields (" name ")
Banji=Data1. You. Fields (" class ")
End the If
If que=kouling Then 'input passwords and password in the database corresponding to
Flag=1
'form2. Show
The Else
MsgBox "password error"
End the If
Data1. You. MoveNext
Next I
'-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- determine whether computer time
StrNow1=Format (Now, "hh: mm: ss")
Nh=Val (Left (strNow1, 2))
Ns=Val (strNow1, 2) (Right)
Nm=Val (Mid (strNow1, 4, 2))
Tnow=(ns + nm * 60 + nh * 3600)
Text3. Text=tnow
On the Error Resume Next
Data2. You. MoveFirst
'-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Dim i2 As Integer
For i2=1 To Data2. You. RecordCount
'Dim xingqi2 As String
If xingqi=Data2. You. Fields (" week ") Then
Dim xingqisan As String
'xingqisan=Data2. You. Fields (" week ")
'Text3. Text=xingqisan
T1=Data2. You. Fields (at the beginning of the "computer time")
Text4. Text=t1
T2=Data2. You. Fields (at the end of the "computer time")
Text5. Text=t2
Nh=Val (Left (t1, 2))
Ns=Val (t1, 2) (Right)
Nm=Val (Mid (t1, 4, 2))
T1n=ms + nm + 3600 * 60 * nh
Text6. Text=t1n
'form2. Label9=t1n
Nh=Val (Left (t2, 2))
Ns=Val (t2, 2) (Right)
Nm=Val (Mid (t2, 4, 2))
T2n=ms + nm + 3600 * 60 * nh
Text7. Text=t2n
'form2. Label10=t2n
'Text4. Text=t1n
'the Text5. Text=t2n
'finalt=t2n
'-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
If (tnow & gt;=t1n) & amp; (tnow & lt;=t2n) Then this time have class
Jishu=jishu + 1
'Text7. Text=jishu
Dim banji2 As String
Banji2=Data2. You. Fields (" class ")
Label3. Caption=banji
Label4. Caption=banji2
The Select Case banji2
Case banji=banji2
M1=1 'with the student of the class in paying computer
End the Select
End the If
End the If

'-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Data2. You. MoveNext
Next i2
'If jishu=0 Then m3=1' paying computer
'End If
The Select Case jishu
Case 0
M3=1
End the Select
'If (jishu & gt; 0 Then m2 And m1=0)=1 'must not be computer
MsgBox "the time has other classes on"
'End If
If=0 m1 And m3=0 Then
M2=1
End the If
If the m2=1 Then
MsgBox "the time has other classes on"
End the If
If m1=1 & amp; Flag=1 Then
'-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- not paid after the success of landing operations
Form2. Label1. Caption=xingming
Form2. Label2. Caption=zhanghao
Form2. Label3. Caption=banji
'students have been on time according to
From2. Timer1. Enabled=True
Data3. You. MoveFirst
Leiji1=Data3. You. Fields (" cumulative time ")
On the Error Resume Next
Data3. You. MoveFirst
For I=1 To Data3. You. RecordCount
Qi=Data3. You. Fields (" used ")
Wu=+ qi wu
Leiji2=Data3. You. Fields (" cumulative time ")
If qi=1 & amp; Leiji2 & lt; Leiji1 Then
Leiji1=leiji2
Jisuanjibianhao=Data3. You. Fields (" computer code ")
End the If
Form2. Label4. Caption=jisuanjibianhao
Data2. You. MoveNext
Next I

If wu=Data3. You. RecordCount Then
MsgBox "free computer free
"The Else
'Form1. Hide
'form2. Show
End the If
End the If

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related