📄 module1.bas
字号:
Attribute VB_Name = "Module1"
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public flag As Integer '记录操作标记
Public view As Integer
Public fratepday As Integer
Public dayslimit As Integer
Public refcopy As Integer
Public maxhold As Integer
Public salnew As Integer
Public saltemp As Integer
Public salper As Integer
Public splashtime As Integer
Public welcometime As Integer
Public uname As String
Public Welcome As Boolean
Dim str As String
Dim conn As ADODB.Connection
Dim rst, modulers As ADODB.Recordset
Public Function exesql(ByVal sql As String) As ADODB.Recordset
sql = Trim$(sql)
Set conn = New ADODB.Connection
conn.CursorLocation = adUseClient
Set rst = New ADODB.Recordset
conn.ConnectionString = "DSN=library;UID=sa;PWD=;"
conn.Open
Set rst.ActiveConnection = conn
rst.LockType = adLockOptimistic
'rst.CursorType = adOpenKeyset
rst.CursorType = 3
rst.Open sql
Set exesql = rst
Set rst = Nothing
Set conn = Nothing
End Function
Sub main()
initsql = "select Dayslimit,Fratepday,Maxhold,Pass,Refcopy,Salnew,Salper,Saltemp,Splashtime,Viewe,Welcometime,Welcome from Custom"
Set modulers = exesql(initsql)
If modulers.Fields(3) = "administerpass" Then
Load frmadmin
frmadmin.Show
Else
Call globalload
End If
End Sub
Public Sub globalload()
view = modulers.Fields(9)
fratepday = modulers.Fields(1)
dayslimit = modulers.Fields(0)
refcopy = modulers.Fields(4)
maxhold = modulers.Fields(2)
salnew = modulers.Fields(5)
saltemp = modulers.Fields(7)
salper = modulers.Fields(6)
splashtime = modulers.Fields(8)
welcometime = modulers.Fields(10)
Welcome = modulers.Fields(11)
Adpass = modulers.Fields(3)
modulers.Close
Load frmSplash
frmSplash.Show
DoEvents
Sleep splashtime
Unload frmSplash
DoEvents
Load frmLogin
Load MDIMain
MDIMain.Show
frmLogin.Show
End Sub
Public Sub logoff()
Unload frmLogin
DoEvents
logsql = "select Dayslimit,Fratepday,Maxhold,Pass,Refcopy,Salnew,Salper,Saltemp,Splashtime,Viewe,Welcometime,Welcome from Custom"
Set modulers = exesql(logsql)
view = modulers.Fields(9)
fratepday = modulers.Fields(1)
dayslimit = modulers.Fields(0)
refcopy = modulers.Fields(4)
maxhold = modulers.Fields(2)
salnew = modulers.Fields(5)
saltemp = modulers.Fields(7)
salper = modulers.Fields(6)
splashtime = modulers.Fields(8)
welcometime = modulers.Fields(10)
Welcome = modulers.Fields(11)
modulers.Close
Load frmLogin
Load MDIMain
DoEvents
MDIMain.Show
frmLogin.Show vbModal
End Sub
Public Sub endata(Keyasc As Integer)
If Keyasc = 13 Then
SendKeys "{TAB}"
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -