mod_main.bas

来自「很经典的抽奖程序」· BAS 代码 · 共 48 行

BAS
48 行
字号
Attribute VB_Name = "Mod_Main"
Option Explicit

Public IntTotalPersonCount As Long                  '记录注册的总人数
Public CnnDSN As New ADODB.Connection               '定义一个全局的连接
Public strFilePath As String                        '取表文件的路径

'*********************************************************************
'名称:
'目的:
'输入:
'返回:
'说明:
'*********************************************************************
Sub Main()
Dim apppath As String
Dim dbfilename As String
Dim connectstring As String
Dim DB_USERID As String
Dim DB_PWS As String
Set CnnDSN = New ADODB.Connection
If Right(App.Path, 1) = "\" Then
                apppath = App.Path
        Else
                apppath = App.Path & "\"
End If
dbfilename = apppath & "Lottery_Table.mdb"
connectstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
                dbfilename & ";Persist Security Info=False;"
                
                On Error Resume Next
                With CnnDSN
                        .CursorLocation = adUseClient
                        
                        .open connectstring, DB_USERID, DB_PWS
                End With
                
'显示欢迎接界面
'Set frm = New frmSplash
'frm.Show
'DoEvents

'frmMain.AddNodes
index.Show
'Unload frm
End Sub

⌨️ 快捷键说明

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