module1.bas
来自「仓库查询系统的管理软件的源代码」· BAS 代码 · 共 45 行
BAS
45 行
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 + =
减小字号Ctrl + -
显示快捷键?