www.pudn.com > cjg2.rar > frmSplash.frm


VERSION 5.00 
Begin VB.Form Splash  
   BorderStyle     =   0  'None 
   Caption         =   "Form1" 
   ClientHeight    =   3585 
   ClientLeft      =   0 
   ClientTop       =   0 
   ClientWidth     =   6045 
   KeyPreview      =   -1  'True 
   LinkTopic       =   "Form1" 
   Picture         =   "frmSplash.frx":0000 
   ScaleHeight     =   3585 
   ScaleWidth      =   6045 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.Timer Timer1  
      Left            =   600 
      Top             =   2280 
   End 
   Begin VB.Label Label1  
      BackStyle       =   0  'Transparent 
      Caption         =   "正在联接数据库服务器…………" 
      Height          =   255 
      Index           =   4 
      Left            =   2115 
      TabIndex        =   6 
      Top             =   2520 
      Width           =   2340 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "版权所有,违者必究            2003年12月" 
      Height          =   180 
      Index           =   6 
      Left            =   1215 
      TabIndex        =   5 
      Top             =   3210 
      Width           =   3600 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "试卷评阅" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   9 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   180 
      Index           =   3 
      Left            =   2430 
      TabIndex        =   4 
      Top             =   1920 
      Width           =   780 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "定制试卷" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   9 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   180 
      Index           =   2 
      Left            =   2430 
      TabIndex        =   3 
      Top             =   1560 
      Width           =   780 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "试题管理" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   9 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   180 
      Index           =   1 
      Left            =   2430 
      TabIndex        =   2 
      Top             =   1200 
      Width           =   780 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "本软件授权给西华大学" 
      Height          =   180 
      Index           =   5 
      Left            =   2122 
      TabIndex        =   1 
      Top             =   2880 
      Width           =   1800 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "欢迎使用自测考试系统" 
      BeginProperty Font  
         Name            =   "隶书" 
         Size            =   18 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   360 
      Index           =   0 
      Left            =   1222 
      TabIndex        =   0 
      Top             =   360 
      Width           =   3600 
   End 
End 
Attribute VB_Name = "Splash" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Private Sub Form_GotFocus() 
    On Error GoTo DealError 
    '测试是否可联接到SQL Server服务器 
    Me.Enabled = False      '在测试完成之前,禁止窗体响应用户操作 
    '创建与数据库的联接 
    Dim objCn As New Connection                  '定义并实例化联接对象 
    With objCn                                   '建立数据库联接 
        .Provider = "SQLOLEDB" 
        .ConnectionString = "User ID=sa;PWD=123;Data Source=(local);" & _ 
                            "Initial Catalog=自测考试" 
        .Open                           '打开数据库联接 
        .Close                          '关闭数据库联接 
    End With 
    Set objCn = Nothing                 '释放数据库联接 
    Label1(4) = "已联接到数据库服务器"  '提示联接到数据库服务器 
    Timer1.Interval = 3000              '启动计数器,定时为三秒 
    Me.Enabled = True                   '允许窗体响应用户操作 
    Exit Sub 
DealError: 
    '在不能正确联接数据库服务起伏时显示提示信息 
    MsgBox "不能正确联接数据库服务器,请与系统管理员联系!", vbCritical 
    Unload Me                           '关闭窗体 
End Sub 
Private Sub Form_Click() 
    Unload Me   '关闭启动屏幕 
    '显示登录窗口 
    SystemLogon.Show: SystemLogon.SetFocus 
End Sub 
 
Private Sub Form_KeyPress(KeyAscii As Integer) 
    Unload Me   '关闭启动屏幕 
    '显示登录窗口 
    SystemLogon.Show: SystemLogon.SetFocus 
End Sub 
 
Private Sub Label1_Click(Index As Integer) 
    Unload Me   '关闭启动屏幕 
    '显示登录窗口 
    SystemLogon.Show: SystemLogon.SetFocus 
End Sub 
 
Private Sub Timer1_Timer() 
    Unload Me   '关闭启动屏幕 
    '显示登录窗口 
    SystemLogon.Show: SystemLogon.SetFocus 
End Sub