📄 bp1print_msg.frm
字号:
VERSION 5.00
Begin VB.Form bp1print_msg
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 2265
ClientLeft = 0
ClientTop = 0
ClientWidth = 4845
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2265
ScaleWidth = 4845
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command3
Enabled = 0 'False
Height = 255
Left = 4590
TabIndex = 5
Top = 0
Width = 255
End
Begin VB.CommandButton Command2
Caption = ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::"
Enabled = 0 'False
Height = 255
Left = 255
TabIndex = 4
Top = 0
Width = 4335
End
Begin VB.CommandButton Command1
Enabled = 0 'False
Height = 255
Left = 0
TabIndex = 3
Top = 0
Width = 255
End
Begin VB.Frame Frame1
Height = 2055
Left = 0
TabIndex = 0
Top = 200
Width = 4815
Begin VB.Timer Timer1
Interval = 100
Left = 3240
Top = 1440
End
Begin VB.Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Please Waiting form a monement..."
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 240
TabIndex = 2
Top = 480
Width = 4215
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Please Waiting form a monement..."
BeginProperty Font
Name = "宋体"
Size = 11.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 855
Left = 220
TabIndex = 1
Top = 460
Width = 4215
End
End
End
Attribute VB_Name = "bp1print_msg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public yy As Integer
Public jj As Integer
Public classcount As Integer
Public studentcount As Integer
Private Sub Timer1_Timer()
Call settext("预处理原始库")
main.connect.Execute "Delete * from [temp] "
main.connect.Execute "Delete * from [tempgz1] "
main.connect.Execute "Delete * from [tempgz2] "
main.connect.Execute "Delete * from [tempgz3] "
main.connect.Execute "Delete * from [tempgz4] "
main.connect.Execute "Delete * from [tt1] "
main.connect.Execute "Delete * from [tt2] "
main.connect.Execute "Delete * from [tt3] "
main.connect.Execute "Delete * from [tt4] "
Call settext("预处理学分制度")
Dim temprecord As New ADODB.Recordset
Dim temprecord1 As New ADODB.Recordset
temprecord.Open "select * from [gz] where [qj]=0 and [xn]='" & yy & "'", main.connect, 3, 2
For i = 1 To 4
If temprecord.EOF = True Then GoTo 2
main.connect.Execute "update [nn] set [nm]='" & temprecord.Fields(1) & "' where [ID]=" & i
idf = temprecord.Fields(0)
main.connect.Execute "insert into [tempgz" & i & "]([ID],[tkmc],[sf],[ef],[jd],[qj],[cs],[zorl]) select [ID],[tkmc],[sf],[ef],[jd],[qj],[cs],[zorl] from [gz]"
main.connect.Execute "update [tempgz" & i & "] set [ii]=true where [ID]=" & idf
For i1 = 1 To 4
main.connect.Execute "update [tempgz" & i & "] set [ii]=true where [qj] in (select [ID] from [tempgz" & i & "] where [ii]=true)"
Next
main.connect.Execute "Delete from [tempgz" & i & "] where [ii]=false"
main.connect.Execute "Delete from [tempgz" & i & "] where [zorl]=true"
temprecord.MoveNext
Next
2
temprecord.Close
For i = 1 To 4
main.connect.Execute "insert into [tt" & i & "]([ID],[tkmc],[sf],[ef],[jd],[qj],[cs],[zorl],[ii]) select * from [tempgz" & i & "]"
Next
For i = 1 To 4
temprecord.Open "select * from [tt" & i & "]", main.connect, 3, 2
For i1 = 1 To temprecord.RecordCount
temprecord1.Open "select * from [gz] where [ID]=" & temprecord.Fields(5), main.connect, 3, 2
While (temprecord1.Fields(5) <> 0)
If temprecord.Fields(9) <> "" Then temprecord.Fields(10) = temprecord.Fields(9)
temprecord.Fields(9) = temprecord.Fields(1)
temprecord.Fields(1) = temprecord1.Fields(1)
temprecord.Fields(5) = temprecord1.Fields(5)
temprecord.Update
temprecord1.Close
temprecord1.Open "select * from [gz] where [ID]=" & temprecord.Fields(5), main.connect, 3, 2
Wend
temprecord1.Close
temprecord.MoveNext
Next
temprecord.Close
Next
Call settext("预处理学生名册")
main.connect.Execute "insert into [temp]([ID],[xh],[nn],[cl]) select [student].[ID],[student].[stid],[student].[na],[class].[na] & '班' from [student],[class] where [student].[clasid]=[class].[ID] and [class].[yid]=" & jj
Call settext("统计学生数目及班级数目")
temprecord.Open "select * from [class] where [yid]=" & jj, main.connect, 3, 2
classcount = temprecord.RecordCount
temprecord.Close
Call settext("计算学生学分")
temprecord.Open "select * from [temp]", main.connect, 3, 2
studentcount = temprecord.RecordCount
For i = 1 To studentcount
Call settext("计算学生学分" & Chr(13) & Chr(10) & "第" & i & "位学生/共" & studentcount & "位学生" & Chr(13) & Chr(10) & CInt(i * 100 / studentcount) & "%")
temprecord1.Open "select * from [wf] where [stid]=" & temprecord.Fields(0) & " and [ye]='" & yy & "'", main.connect, 3, 2
If temprecord1.RecordCount <> 0 Then
temprecord.Fields(4) = temprecord1.Fields(3)
End If
temprecord1.Close
For i1 = 1 To 4
'temprecord1.Open "select sum([jc].[jd] * [tempgz" & i1 & "].[jd]) from [jc],[tempgz" & i1 & "] where [jc].[gzid]=[tempgz" & i1 & "].[ID] and [jc].[xn]='" & yy & "' and [jc].[stid]=" & temprecord.Fields(0) & " group by [jc].[jd] * [tempgz" & i1 & "].[jd]", main.connect, 3, 2
'MsgBox "select sum([jc].[jd] * [tempgz" & i1 & "].[jd]) from [jc],[tempgz" & i1 & "] where [jc].[gzid]=[tempgz" & i1 & "].[ID] and [jc].[xn]='" & yy & "' and [jc].[stid]=" & temprecord.Fields(0) & " group by [jc].[jd] * [tempgz" & i1 & "].[jd]"
temprecord1.Open "select [jc].[jd] , [tempgz" & i1 & "].[jd] from [jc],[tempgz" & i1 & "] where [jc].[gzid]=[tempgz" & i1 & "].[ID] and [jc].[xn]='" & yy & "' and [jc].[stid]=" & temprecord.Fields(0), main.connect, 3, 2
'MsgBox "select [jc].[jd] , [tempgz" & i1 & "].[jd] from [jc],[tempgz" & i1 & "] where [jc].[gzid]=[tempgz" & i1 & "].[ID] and [jc].[xn]='" & yy & "' and [jc].[stid]=" & temprecord.Fields(0)
'MsgBox temprecord1.RecordCount
fentemp = 0
For kk = 1 To temprecord1.RecordCount
fentemp = fentemp + temprecord1.Fields(0) * temprecord1.Fields(1)
temprecord1.MoveNext
Next
temprecord.Fields(4 + i1) = fentemp
temprecord1.Close
Next
temprecord.Update
temprecord.MoveNext
Next
main.connect.Execute "update [temp] set [zf]=[whk]+[x1]+[x2]+[x3]+[x4]"
main.connect.Execute "update [temp] set [x1]=[whk]+[x1]"
Call settext("处理完成")
1
Unload Me
End Sub
Sub settext(tt As String)
Label1.Caption = tt
Label2.Caption = tt
DoEvents
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -