www.pudn.com > textmanager.rar > FrmLookFor.frm, change:2005-04-12,size:24842b


VERSION 5.00 
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" 
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" 
Begin VB.Form FrmLookFor  
   BorderStyle     =   0  'None 
   Caption         =   "成绩查询" 
   ClientHeight    =   9000 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   12000 
   LinkTopic       =   "Form1" 
   LockControls    =   -1  'True 
   Picture         =   "FrmLookFor.frx":0000 
   ScaleHeight     =   9000 
   ScaleWidth      =   12000 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   1  '所有者中心 
   WindowState     =   2  'Maximized 
   Begin VB.ComboBox CmbNianJI  
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   330 
      Left            =   4950 
      Style           =   2  'Dropdown List 
      TabIndex        =   28 
      Top             =   7575 
      Width           =   1485 
   End 
   Begin VB.ComboBox CmbKeMu  
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   330 
      Left            =   2880 
      Style           =   2  'Dropdown List 
      TabIndex        =   26 
      Top             =   7575 
      Width           =   1485 
   End 
   Begin VB.CheckBox CheDay  
      Appearance      =   0  'Flat 
      BackColor       =   &H00E8F4F8& 
      ForeColor       =   &H80000008& 
      Height          =   195 
      Left            =   285 
      TabIndex        =   19 
      Top             =   8145 
      Width           =   195 
   End 
   Begin VB.TextBox TXTTitle  
      Appearance      =   0  'Flat 
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   315 
      Left            =   2220 
      TabIndex        =   18 
      Top             =   8490 
      Width           =   3795 
   End 
   Begin VB.TextBox TXTScore  
      Appearance      =   0  'Flat 
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   315 
      Left            =   1410 
      TabIndex        =   15 
      Top             =   7590 
      Width           =   495 
   End 
   Begin VB.ComboBox CmbCZS  
      BackColor       =   &H00E8F4F8& 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   330 
      ItemData        =   "FrmLookFor.frx":A00B 
      Left            =   705 
      List            =   "FrmLookFor.frx":A01B 
      Style           =   2  'Dropdown List 
      TabIndex        =   14 
      Top             =   7575 
      Width           =   675 
   End 
   Begin VB.ListBox List1  
      Appearance      =   0  'Flat 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   5310 
      ItemData        =   "FrmLookFor.frx":A02C 
      Left            =   1050 
      List            =   "FrmLookFor.frx":A02E 
      TabIndex        =   8 
      Top             =   1260 
      Width           =   2685 
   End 
   Begin MSComctlLib.ImageList ImageList1  
      Left            =   3420 
      Top             =   0 
      _ExtentX        =   1005 
      _ExtentY        =   1005 
      BackColor       =   -2147483643 
      MaskColor       =   12632256 
      _Version        =   393216 
   End 
   Begin MSComCtl2.UpDown UDScore  
      Height          =   315 
      Left            =   1905 
      TabIndex        =   16 
      Top             =   7590 
      Width           =   270 
      _ExtentX        =   476 
      _ExtentY        =   556 
      _Version        =   393216 
      BuddyControl    =   "TXTScore" 
      BuddyDispid     =   196613 
      OrigLeft        =   1995 
      OrigTop         =   705 
      OrigRight       =   2265 
      OrigBottom      =   1020 
      Max             =   300 
      SyncBuddy       =   -1  'True 
      BuddyProperty   =   0 
      Enabled         =   -1  'True 
   End 
   Begin MSComCtl2.DTPicker DTPS  
      Height          =   315 
      Left            =   1260 
      TabIndex        =   20 
      Top             =   8070 
      Width           =   1440 
      _ExtentX        =   2540 
      _ExtentY        =   556 
      _Version        =   393216 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      CalendarBackColor=   15267064 
      CalendarTitleBackColor=   12632256 
      Format          =   24903681 
      CurrentDate     =   37024 
   End 
   Begin MSComCtl2.DTPicker DTPE  
      Height          =   315 
      Left            =   2940 
      TabIndex        =   21 
      Top             =   8085 
      Width           =   1440 
      _ExtentX        =   2540 
      _ExtentY        =   556 
      _Version        =   393216 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      CalendarBackColor=   15267064 
      Format          =   24903681 
      CurrentDate     =   37024 
   End 
   Begin VB.Image Image2  
      Height          =   960 
      Left            =   8625 
      MouseIcon       =   "FrmLookFor.frx":A030 
      MousePointer    =   99  'Custom 
      Picture         =   "FrmLookFor.frx":A472 
      Top             =   7740 
      Width           =   1305 
   End 
   Begin VB.Image ImgSeach  
      Height          =   960 
      Left            =   6480 
      MouseIcon       =   "FrmLookFor.frx":D314 
      MousePointer    =   99  'Custom 
      Picture         =   "FrmLookFor.frx":D756 
      Top             =   7755 
      Width           =   1305 
   End 
   Begin VB.Image Image1  
      Height          =   960 
      Left            =   10350 
      MouseIcon       =   "FrmLookFor.frx":FC1C 
      MousePointer    =   99  'Custom 
      Picture         =   "FrmLookFor.frx":1005E 
      Top             =   7800 
      Width           =   1305 
   End 
   Begin VB.Label Label11  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "已经判卷的考试:" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   15 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   300 
      Left            =   1110 
      TabIndex        =   29 
      Top             =   900 
      Width           =   2535 
   End 
   Begin VB.Label Label9  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "年级:" 
      ForeColor       =   &H000000C0& 
      Height          =   180 
      Left            =   4485 
      TabIndex        =   27 
      Top             =   7665 
      Width           =   450 
   End 
   Begin VB.Label Label8  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "科目:" 
      ForeColor       =   &H000000C0& 
      Height          =   180 
      Left            =   2415 
      TabIndex        =   25 
      Top             =   7665 
      Width           =   450 
   End 
   Begin VB.Label Label2  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "考试日期" 
      ForeColor       =   &H000000C0& 
      Height          =   180 
      Left            =   495 
      TabIndex        =   24 
      Top             =   8160 
      Width           =   720 
   End 
   Begin VB.Label Label6  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "试卷标题(支持模糊查询)" 
      ForeColor       =   &H000000C0& 
      Height          =   180 
      Index           =   2 
      Left            =   240 
      TabIndex        =   23 
      Top             =   8550 
      Width           =   1980 
   End 
   Begin VB.Label Label7  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "到" 
      ForeColor       =   &H000000C0& 
      Height          =   180 
      Index           =   2 
      Left            =   2745 
      TabIndex        =   22 
      Top             =   8145 
      Width           =   180 
   End 
   Begin VB.Label Label6  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "成绩:" 
      ForeColor       =   &H000000C0& 
      Height          =   180 
      Index           =   0 
      Left            =   225 
      TabIndex        =   17 
      Top             =   7665 
      Width           =   540 
   End 
   Begin VB.Shape Shape1  
      BorderColor     =   &H000000C0& 
      BorderWidth     =   2 
      Height          =   1350 
      Left            =   120 
      Top             =   7530 
      Width           =   7860 
   End 
   Begin VB.Label Label7  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "所属年级:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   285 
      Index           =   1 
      Left            =   7950 
      TabIndex        =   13 
      Top             =   2775 
      Width           =   1515 
   End 
   Begin VB.Label LabNianJi  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "h" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   15 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   300 
      Left            =   9375 
      TabIndex        =   12 
      Top             =   2805 
      Width           =   180 
   End 
   Begin VB.Label Label3  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "所属科目:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   285 
      Left            =   4365 
      TabIndex        =   11 
      Top             =   2730 
      Width           =   1380 
   End 
   Begin VB.Label LabKeMu  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "h" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   15 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   300 
      Left            =   5775 
      TabIndex        =   10 
      Top             =   2745 
      Width           =   180 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "以下为你参加过" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   15 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   300 
      Left            =   360 
      TabIndex        =   9 
      Top             =   540 
      Width           =   2220 
   End 
   Begin VB.Label Labtesttime  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "2001-01-21" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   15.75 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   315 
      Left            =   6990 
      TabIndex        =   7 
      Top             =   4440 
      Width           =   2085 
   End 
   Begin VB.Label Labscore  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "100" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   15.75 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   315 
      Left            =   5730 
      TabIndex        =   6 
      Top             =   3555 
      Width           =   555 
   End 
   Begin VB.Label Labzscore  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "100" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   15.75 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   315 
      Left            =   9435 
      TabIndex        =   5 
      Top             =   3540 
      Width           =   555 
   End 
   Begin VB.Label Label10  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "考试时间:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   285 
      Left            =   5610 
      TabIndex        =   4 
      Top             =   4440 
      Width           =   1515 
   End 
   Begin VB.Label Labtesttitle  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "hhhh" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   15 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   300 
      Left            =   4230 
      TabIndex        =   3 
      Top             =   1785 
      Width           =   675 
   End 
   Begin VB.Label Label6  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "试卷得分:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   285 
      Index           =   1 
      Left            =   4350 
      TabIndex        =   2 
      Top             =   3540 
      Width           =   1515 
   End 
   Begin VB.Label Label5  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "试卷总分:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   285 
      Left            =   7950 
      TabIndex        =   1 
      Top             =   3540 
      Width           =   1515 
   End 
   Begin VB.Label Label4  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "试卷标题:" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H000000C0& 
      Height          =   285 
      Left            =   4350 
      TabIndex        =   0 
      Top             =   1470 
      Width           =   1515 
   End 
End 
Attribute VB_Name = "FrmLookFor" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
'定义一个数组来保存对应试卷的id 
Dim TestIDArr() As Long 
Dim KeMuIDArr() As Long 
Dim NianJiIDarr() As Long 
 
 
 
Private Sub Command3_Click() 
 
End Sub 
 
Private Sub Form_Load() 
 
Dim i As Integer 
'添加LIST选项 
Dim adoRS As Recordset 
Set adoRS = New Recordset 
adoRS.CursorLocation = adUseClient 
adoRS.Open "select score.id,test.title from score,test where score.complete='T' and score.testid=test.id and score.studentid=" & StudentID, ConnString, adOpenStatic, adLockOptimistic 
If Not adoRS.EOF Then 
   adoRS.MoveLast 
   adoRS.MoveFirst 
   ReDim TestIDArr(adoRS.RecordCount) As Long 
   For i = 0 To adoRS.RecordCount - 1 
     List1.AddItem adoRS.Fields(1).Value 
     TestIDArr(i) = adoRS.Fields(0).Value 
     adoRS.MoveNext 
   Next i 
End If 
 
adoRS.Close 
'年级 
adoRS.Open "select id,name from nianji", ConnString, adOpenStatic, adLockOptimistic 
CmbNianJI.AddItem "所有年级" 
If Not adoRS.EOF Then 
  adoRS.MoveLast 
  adoRS.MoveFirst 
  ReDim NianJiIDarr(adoRS.RecordCount) As Long 
  For i = 0 To adoRS.RecordCount - 1 
     CmbNianJI.AddItem adoRS.Fields("name").Value 
     NianJiIDarr(i) = adoRS.Fields("id").Value 
     adoRS.MoveNext 
  Next i 
End If 
adoRS.Close 
'科目 
adoRS.Open "kemu", ConnString, adOpenStatic, adLockOptimistic 
CmbKeMu.AddItem "所有科目" 
If Not adoRS.EOF Then 
  adoRS.MoveLast 
  adoRS.MoveFirst 
  ReDim KeMuIDArr(adoRS.RecordCount) As Long 
  For i = 0 To adoRS.RecordCount - 1 
     CmbKeMu.AddItem adoRS.Fields("name").Value 
     KeMuIDArr(i) = adoRS.Fields("id").Value 
     adoRS.MoveNext 
  Next i 
End If 
 
Set adoRS = Nothing 
List1.ListIndex = 0 
'=====提示没做过任何试卷 
'初始化处理 
CmbCZS.ListIndex = 0 
CmbKeMu.ListIndex = 0 
CmbNianJI.ListIndex = 0 
 
End Sub 
 
Private Sub Image1_Click() 
  Unload Me 
End Sub 
 
Private Sub Image2_Click() 
  If List1.ListIndex < 0 Then 
MsgBox "你还没有选择要浏览的试卷呢!" 
Exit Sub 
End If 
 '生成HTML文件 
CreateHTML App.Path + "\temp.html", TestIDArr(List1.ListIndex) 
FrmView.Web.Navigate App.Path + "\temp.html" 
FrmView.Show 1 
End Sub 
 
Private Sub ImgSeach_Click() 
   Dim adoRS As Recordset 
 '定义查询条件,保存各个查询条件 
 Dim SqlScore As String 
 Dim SqlTitle As String 
 Dim SqlDay As String 
 Dim SqlKeMu As String 
 Dim SqlNianJI As String 
 Dim sql As String 
 Dim i As Integer 
 Set adoRS = New Recordset 
 adoRS.CursorLocation = adUseClient 
 
 '设置试卷标题 
 If TXTTitle.Text <> "" Then 
   SqlTitle = " and test.title like '%" + TXTTitle.Text + "%'" 
  Else 
   SqlTitle = "" 
 End If 
 '设置分数 
 If TXTScore.Text <> "" Then 
   SqlScore = " and score.score" + CmbCZS.Text + TXTScore.Text 
  Else 
   SqlScore = "" 
 End If 
 '设置考试日期 
 If CheDay.Value = 1 Then 
   SqlDay = " and score.testtime>='" + Date2Str(DTPS.Value) + "' and score.testtime<='" + Date2Str(DTPE.Value) + "'" 
  Else 
   SqlDay = "" 
 End If 
 '设置年级 
 If CmbNianJI.ListIndex = 0 Then 
   SqlNianJI = "" 
  Else 
   SqlNianJI = " and test.nianjiid=" & NianJiIDarr(CmbNianJI.ListIndex - 1) 
 End If 
 '设置科目 
 If CmbKeMu.ListIndex = 0 Then 
   SqlKeMu = "" 
  Else 
   SqlKeMu = " and test.kemuid=" & KeMuIDArr(CmbKeMu.ListIndex - 1) 
 End If 
'========================================== 
 sql = "select test.title,score.id from test,score where test.id=score.testid and score.complete='T'" 
 sql = sql + SqlDay + SqlKeMu + SqlNianJI + SqlTitle + SqlScore 
 adoRS.Open sql, ConnString, adOpenStatic, adLockOptimistic 
 List1.Clear 
If Not adoRS.EOF Then 
   adoRS.MoveLast 
   adoRS.MoveFirst 
   ReDim TestIDArr(adoRS.RecordCount) As Long 
   For i = 0 To adoRS.RecordCount - 1 
     List1.AddItem adoRS.Fields(0).Value 
     TestIDArr(i) = adoRS.Fields(1).Value 
     adoRS.MoveNext 
   Next i 
End If 
Set adoRS = Nothing 
End Sub 
 
Private Sub List1_Click() 
 Dim ScoreRs  As Recordset 
 Set ScoreRs = New Recordset 
 ScoreRs.CursorLocation = adUseClient 
 
 ScoreRs.Open "select test.title,kemu.name,nianji.name,score.score,test.zscore,score.testtime from score,test,kemu,nianji where score.testid=test.id and test.kemuid=kemu.id and test.nianjiid=nianji.id and score.studentid=" & StudentID & " and score.id=" + Str(TestIDArr(List1.ListIndex)), ConnString, adOpenStatic, adLockOptimistic 
 Labtesttitle.Caption = ScoreRs.Fields(0).Value 
 LabKeMu.Caption = ScoreRs.Fields(1).Value 
 LabNianJi.Caption = ScoreRs.Fields(2).Value 
 Labzscore.Caption = ScoreRs.Fields(4).Value 
 Labscore.Caption = ScoreRs.Fields(3).Value 
 Labtesttime.Caption = ScoreRs.Fields(5).Value 
 Set ScoreRs = Nothing 
End Sub 
 
Function Date2Str(ByVal DT As Date) As String  '日期转化成字符 
  Dim DateStr As String 
  DateStr = Format(DT, "YYYY-MM-DD") 
  Date2Str = DateStr 
End Function 
 
Private Sub TXTScore_KeyPress(KeyAscii As Integer) 
    If Not ((KeyAscii >= 48 And KeyAscii <= 57) Or KeyAscii = 8 Or KeyAscii = 46) Then 
  KeyAscii = 0 
 End If 
 
End Sub 
 
Private Sub TXTTitle_KeyPress(KeyAscii As Integer) 
    If KeyAscii = 39 Then KeyAscii = -24145 
 
End Sub