📄 module.bas
字号:
Attribute VB_Name = "Module"
' First we have the two most inportent part of database using, infect the two only objects
' that need to be used when working whit database.
Public db As Database ' DAO->Database object, used to do load the database.
Public rsData As Recordset ' DAO->RecordSet object, used to store Database records.
' We have more then one Recordset object, and use the same Database object for them all.
' ---------------------------------------------------------------------------------------
' Sub Main()
' I allways use whit when i start programs, It allows me to do all memory loading before
' the main window is shown.
Sub Main()
' First we need to open the database, we do that by using OpenDatabase, and Set it to our db object
Set db = OpenDatabase(App.Path & "\Test Database.mdb") ' DAO->DBEngine->OpenDatabase
' Next we open the Table into the Recordset object, We do this be using db.OpenRecordset
Set rsData = db.OpenRecordset("Work") ' DAO->Database->OpenRecordset
'If we are going to use more then one Recordset object, then use the same funcsion as we just used.
'Now we are done loading the database and its time to show the ain window.
frmMain.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -