📄 modmanage.bas
字号:
Attribute VB_Name = "modManage"
Option Explicit
Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public strCN As String
Public Const MF_BYPOSITION = &H400&
Public gblnLoadError As Boolean '检查启动时是否连接上数据库,flase为未找到错误,true为找到错误
Public adoConn As New ADODB.Connection '与数据库连接相关的参数和属性
Public adoLink As New ADODB.Recordset
Public adoMainLink As New ADODB.Recordset
Public gstrName As String
Public gblnPopedom As Boolean
Public gstrLink As String
Public gstrCN As String
Public nodName As Node
Public nodLong(2) As Integer '结点
Public intCount As Integer
Public strTvwName As String
Public blnCbo As Boolean
Public blnLogout As Boolean
Public strTemp(2) As String
'Public blnBoot(7) As Boolean '0为空
Public intMonth As Integer
Public intHYear As Integer
Public intHMonth As Integer
Public intHday As Integer
Public lDocumentCount As Long
Public strString As String
Public blnInfo As Boolean
Public intPalCount(1) As Integer
Public Sub Shutdown(Optional ByVal force As Boolean = False) '自定义关闭函数
Dim lngFrmSum As Long
On Error Resume Next
Set adoConn = Nothing
Set adoLink = Nothing
Set adoMainLink = Nothing
For lngFrmSum = Forms.Count - 1 To 0 Step -1
Unload Forms(lngFrmSum)
If Not force Then
If Forms.Count > lngFrmSum Then
Exit Sub
End If
End If
Next lngFrmSum
If force Or (Forms.Count > 0) Then End
End Sub
Sub DisSysMenu(ByVal hWnd&, ByVal MenuIndex&) '自定义菜单的关闭按钮失效
Dim SystemMenu&, Res&
SystemMenu& = GetSystemMenu(hWnd, 0)
Res& = RemoveMenu(SystemMenu&, MenuIndex&, MF_BYPOSITION)
End Sub
Sub Main() '系统初始化
If App.PrevInstance Then
MsgBox ("程序已经运行,不能再次装载。"), vbOKOnly + vbExclamation, App.Title
End
End If
blnInfo = False
gblnLoadError = False
gstrLink = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\人力资源.mdb;Persist Security Info=True"
frmLogin.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -