module1.bas
来自「学生信息管理系统.一个简单的学生信息管理系统,可以做些日常学生信息的管理.」· BAS 代码 · 共 51 行
BAS
51 行
Attribute VB_Name = "Module1"
Public CurrentUserName As String '保存当前用户用户名
Public CurrentUserPassword As String '保存当前用户登录口令
Public CurrentUserStatus As String '保存当前用户身份
Public CurrentUserLogonTime As String '保存当前用户登陆次数
Public LastUserLogonTime As String '保存上次登陆时间
Public LastUserLogonDate As String '保存上次登陆日期
Public objCn As New Connection
Public strSQL As String
Public strCn As String
Public objRs As New Recordset
Public intLogTimes As Integer
Public Const MAXP = 60
Public Function Connect_Database() As Byte
'建立数据库连接
Dim temp As String
temp = App.Path & "\数据库\网络0431班学生名单.MDB"
strCn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & temp
objCn.ConnectionString = strCn
objCn.ConnectionTimeout = 30
objCn.Open
End Function
Public Function Close_Database() As Byte
objCn.Close
Set objRs = Nothing
Set objCn = Nothing
End Function
Public Function GetIColor(iColor As Integer, Optional ByVal i As Integer) As Long
Dim per As Single
i = iColor + i
i = i Mod MAXP
per = CLng(&HFF) * 6 / MAXP
Select Case i
Case 1 To MAXP / 6: GetIColor = RGB(255, per * i, 0)
Case MAXP / 6 To MAXP / 3: GetIColor = RGB(255 - per * (i - MAXP / 6), 255, 0)
Case MAXP / 3 To MAXP / 2: GetIColor = RGB(0, 255, per * (i - MAXP / 3))
Case MAXP / 2 To 2 * MAXP / 3: GetIColor = RGB(0, 255 - per * (i - MAXP / 2), 255)
Case 2 * MAXP / 3 To 5 * MAXP / 6: GetIColor = RGB(per * (i - 2 * MAXP / 3), 0, 255)
Case 5 * MAXP / 6 To MAXP: GetIColor = RGB(255, 0, 255 - per * (i - 5 * MAXP / 6))
End Select
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?