📄 module1.bas
字号:
Attribute VB_Name = "Module1"
Option Explicit
Public cnnDatabase As New ADODB.Connection
Public strNowUser As String
Public flagAddSupplier As Boolean
Public flagAddCustomer As Boolean
Public Function ConnectDB() As Boolean
On Error GoTo ErrorHandle
Dim e As ADODB.Error
ConnectDB = True
cnnDatabase.Errors.Clear
cnnDatabase.CommandTimeout = 60
cnnDatabase.ConnectionTimeout = 60
cnnDatabase.ConnectionString = "driver={microsoft access driver (*.mdb)}; dbq=" _
& App.Path & "\yanruyue.mdb"
cnnDatabase.Open
Exit Function
ErrorHandle:
If cnnDatabase.Errors.Count < 1 Then
MsgBox Err.Description, vbOKOnly + vbExclamation
Else
For Each e In cnnDatabase.Errors
MsgBox e.Description
Next e
End If
ConnectDB = False
Set cnnDatabase = Nothing
Exit Function
End Function
Public Function MSFBackColor(msf As MSFlexGrid, i As Integer)
Dim coli As Integer
With msf
.Row = i
For coli = 0 To Int((.Cols - 1) / 2)
.Col = 2 * coli
.CellBackColor = &HC0FFFF
Next
End With
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -