⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 module1.bas

📁 房产信息管理系统 VB+ACCESS 值得借鉴
💻 BAS
字号:
Attribute VB_Name = "Module1"
Option Explicit
'声明窗体状态(加载或卸载)变量
Public Form(2 To 4) As Boolean
'声明全局数据库连接对象
Public conn As New ADODB.Connection
'声明窗体置顶函数
Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
'程序启动入口
Public Sub main()
On Error GoTo error
Dim cs As String
'检查是否重复启动
If App.PrevInstance Then
MsgBox "您已经启动过了本程序!"
Exit Sub
End If
'连接数据库
cs = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\House.mdb;Persist Security Info=False"
conn.Open cs
'显示主窗体
Form1.Show
Exit Sub
error:
MsgBox Err.Description, vbExclamation
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -