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


VERSION 5.00 
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX" 
Begin VB.Form FrmSJSet  
   BorderStyle     =   3  'Fixed Dialog 
   Caption         =   "设置随机生成试卷的信息" 
   ClientHeight    =   3135 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   4890 
   ControlBox      =   0   'False 
   LinkTopic       =   "Form1" 
   LockControls    =   -1  'True 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   3135 
   ScaleWidth      =   4890 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton CmdExit  
      Caption         =   "关闭" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   360 
      Left            =   3795 
      TabIndex        =   12 
      Top             =   2685 
      Width           =   750 
   End 
   Begin VB.CommandButton CmdOK  
      Caption         =   "确定" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   10.5 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   360 
      Left            =   2925 
      TabIndex        =   11 
      Top             =   2685 
      Width           =   750 
   End 
   Begin VB.Frame Frame1  
      Height          =   2565 
      Left            =   60 
      TabIndex        =   0 
      Top             =   0 
      Width           =   4785 
      Begin VB.TextBox TXTdiD  
         Appearance      =   0  'Flat 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   12 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   3780 
         Locked          =   -1  'True 
         TabIndex        =   21 
         Text            =   "0" 
         Top             =   360 
         Width           =   510 
      End 
      Begin VB.TextBox TXTZhongD  
         Appearance      =   0  'Flat 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   12 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   3780 
         Locked          =   -1  'True 
         TabIndex        =   19 
         Text            =   "0" 
         Top             =   1185 
         Width           =   510 
      End 
      Begin VB.TextBox TXTGaoD  
         Appearance      =   0  'Flat 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   12 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   3765 
         Locked          =   -1  'True 
         TabIndex        =   18 
         Text            =   "0" 
         Top             =   1980 
         Width           =   510 
      End 
      Begin VB.TextBox TXTGao  
         Appearance      =   0  'Flat 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   12 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   2220 
         Locked          =   -1  'True 
         TabIndex        =   8 
         Text            =   "0" 
         Top             =   1980 
         Width           =   510 
      End 
      Begin VB.TextBox TXTZhong  
         Appearance      =   0  'Flat 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   12 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   2235 
         Locked          =   -1  'True 
         TabIndex        =   5 
         Text            =   "0" 
         Top             =   1185 
         Width           =   510 
      End 
      Begin MSComCtl2.UpDown UDDi  
         Height          =   315 
         Left            =   2745 
         TabIndex        =   3 
         Top             =   345 
         Width           =   270 
         _ExtentX        =   476 
         _ExtentY        =   556 
         _Version        =   393216 
         BuddyControl    =   "TXTDi" 
         BuddyDispid     =   196617 
         OrigLeft        =   2385 
         OrigTop         =   345 
         OrigRight       =   2655 
         OrigBottom      =   675 
         Max             =   200 
         SyncBuddy       =   -1  'True 
         BuddyProperty   =   0 
         Enabled         =   -1  'True 
      End 
      Begin VB.TextBox TXTDi  
         Appearance      =   0  'Flat 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   12 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   315 
         Left            =   2235 
         Locked          =   -1  'True 
         TabIndex        =   2 
         Text            =   "0" 
         Top             =   345 
         Width           =   510 
      End 
      Begin MSComCtl2.UpDown UDZhong  
         Height          =   315 
         Left            =   2745 
         TabIndex        =   6 
         Top             =   1185 
         Width           =   270 
         _ExtentX        =   476 
         _ExtentY        =   556 
         _Version        =   393216 
         BuddyControl    =   "TXTZhong" 
         BuddyDispid     =   196616 
         OrigLeft        =   2385 
         OrigTop         =   1170 
         OrigRight       =   2655 
         OrigBottom      =   1500 
         Max             =   200 
         SyncBuddy       =   -1  'True 
         BuddyProperty   =   0 
         Enabled         =   -1  'True 
      End 
      Begin MSComCtl2.UpDown UDGao  
         Height          =   315 
         Left            =   2745 
         TabIndex        =   9 
         Top             =   1980 
         Width           =   270 
         _ExtentX        =   476 
         _ExtentY        =   556 
         _Version        =   393216 
         BuddyControl    =   "TXTGao" 
         BuddyDispid     =   196615 
         OrigLeft        =   2370 
         OrigTop         =   1965 
         OrigRight       =   2640 
         OrigBottom      =   2295 
         Max             =   200 
         SyncBuddy       =   -1  'True 
         BuddyProperty   =   0 
         Enabled         =   -1  'True 
      End 
      Begin MSComCtl2.UpDown UDDiD  
         Height          =   315 
         Left            =   4290 
         TabIndex        =   20 
         Top             =   360 
         Width           =   270 
         _ExtentX        =   476 
         _ExtentY        =   556 
         _Version        =   393216 
         BuddyControl    =   "TXTdiD" 
         BuddyDispid     =   196612 
         OrigLeft        =   2385 
         OrigTop         =   345 
         OrigRight       =   2655 
         OrigBottom      =   675 
         Max             =   200 
         SyncBuddy       =   -1  'True 
         BuddyProperty   =   0 
         Enabled         =   -1  'True 
      End 
      Begin MSComCtl2.UpDown UDZhongD  
         Height          =   330 
         Left            =   4290 
         TabIndex        =   22 
         Top             =   1185 
         Width           =   270 
         _ExtentX        =   476 
         _ExtentY        =   582 
         _Version        =   393216 
         BuddyControl    =   "TXTZhongD" 
         BuddyDispid     =   196613 
         OrigLeft        =   2385 
         OrigTop         =   1170 
         OrigRight       =   2655 
         OrigBottom      =   1500 
         Max             =   200 
         SyncBuddy       =   -1  'True 
         BuddyProperty   =   0 
         Enabled         =   -1  'True 
      End 
      Begin MSComCtl2.UpDown UDGaoD  
         Height          =   330 
         Left            =   4275 
         TabIndex        =   23 
         Top             =   1965 
         Width           =   270 
         _ExtentX        =   476 
         _ExtentY        =   582 
         _Version        =   393216 
         BuddyControl    =   "TXTGaoD" 
         BuddyDispid     =   196614 
         OrigLeft        =   2370 
         OrigTop         =   1965 
         OrigRight       =   2640 
         OrigBottom      =   2295 
         Max             =   200 
         SyncBuddy       =   -1  'True 
         BuddyProperty   =   0 
         Enabled         =   -1  'True 
      End 
      Begin VB.Label Label12  
         Caption         =   "(多项)" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H000000FF& 
         Height          =   270 
         Left            =   3165 
         TabIndex        =   26 
         Top             =   390 
         Width           =   645 
      End 
      Begin VB.Label Label11  
         Caption         =   "(多项)" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H000000FF& 
         Height          =   270 
         Left            =   3165 
         TabIndex        =   25 
         Top             =   1215 
         Width           =   645 
      End 
      Begin VB.Label Label10  
         Caption         =   "(多项)" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H000000FF& 
         Height          =   270 
         Left            =   3150 
         TabIndex        =   24 
         Top             =   2010 
         Width           =   645 
      End 
      Begin VB.Label Label9  
         AutoSize        =   -1  'True 
         BackStyle       =   0  'Transparent 
         Caption         =   "难度题目数:" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H80000008& 
         Height          =   210 
         Left            =   510 
         TabIndex        =   17 
         Top             =   2010 
         Width           =   1260 
      End 
      Begin VB.Label Label5  
         AutoSize        =   -1  'True 
         Caption         =   "高" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   210 
         Left            =   285 
         TabIndex        =   16 
         Top             =   2010 
         Width           =   210 
      End 
      Begin VB.Label Label8  
         AutoSize        =   -1  'True 
         BackStyle       =   0  'Transparent 
         Caption         =   "难度题目数:" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H80000008& 
         Height          =   210 
         Left            =   510 
         TabIndex        =   15 
         Top             =   1230 
         Width           =   1260 
      End 
      Begin VB.Label Label3  
         AutoSize        =   -1  'True 
         Caption         =   "中" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   210 
         Left            =   285 
         TabIndex        =   14 
         Top             =   1230 
         Width           =   210 
      End 
      Begin VB.Label Label7  
         AutoSize        =   -1  'True 
         BackStyle       =   0  'Transparent 
         Caption         =   "难度题目数:" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H80000008& 
         Height          =   210 
         Left            =   510 
         TabIndex        =   13 
         Top             =   405 
         Width           =   1260 
      End 
      Begin VB.Label Label6  
         Caption         =   "(单项)" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H000000FF& 
         Height          =   270 
         Left            =   1605 
         TabIndex        =   10 
         Top             =   2025 
         Width           =   675 
      End 
      Begin VB.Shape Shape3  
         Height          =   510 
         Left            =   120 
         Top             =   1875 
         Width           =   4560 
      End 
      Begin VB.Label Label4  
         Caption         =   "(单项)" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H000000FF& 
         Height          =   270 
         Left            =   1620 
         TabIndex        =   7 
         Top             =   1230 
         Width           =   675 
      End 
      Begin VB.Shape Shape2  
         Height          =   510 
         Left            =   135 
         Top             =   1080 
         Width           =   4560 
      End 
      Begin VB.Label Label2  
         Caption         =   "(单项)" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H000000FF& 
         Height          =   270 
         Left            =   1620 
         TabIndex        =   4 
         Top             =   405 
         Width           =   675 
      End 
      Begin VB.Label Label1  
         AutoSize        =   -1  'True 
         Caption         =   "低" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   10.5 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00FF0000& 
         Height          =   210 
         Left            =   285 
         TabIndex        =   1 
         Top             =   405 
         Width           =   210 
      End 
      Begin VB.Shape Shape1  
         Height          =   510 
         Left            =   135 
         Top             =   255 
         Width           =   4560 
      End 
   End 
   Begin VB.Shape Shape4  
      BackColor       =   &H00C0C0C0& 
      BackStyle       =   1  'Opaque 
      BorderColor     =   &H00404040& 
      BorderWidth     =   2 
      Height          =   480 
      Left            =   60 
      Top             =   2640 
      Width           =   4785 
   End 
End 
Attribute VB_Name = "FrmSJSet" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
'保存各类型的ID 
Dim IdDi() As Long 
Dim IdZhong() As Long 
Dim IdGao() As Long 
Dim IdDiD() As Long 
Dim IdZhongD() As Long 
Dim IdGaoD() As Long 
Private Sub CmdExit_Click() 
  Unload Me 
End Sub 
 
Private Sub cmdOK_Click() 
  '产生随机数 
 Dim i As Long 
 Dim j As Long 
 Dim TempID As Long 
 Dim TCount As Long 
 Dim TMcount As Long 
 Dim IdtempArr() As Long 
 Dim ShiFouCZ As Boolean '表示产生的id是否已经存在了 
 '初始 
 FrmShiJuan.LstTM.Clear 
 FrmShiJuan.LstTMD.Clear 
   
  '产生低单 
 TMcount = Val(TXTDi.Text) 
 ReDim IdtempArr(TMcount) As Long 
 TCount = 0 
 Do While TCount < TMcount 
  TempID = Round(Rnd * IdDi(UDDi.Max - 1)) + 1 
  For i = 0 To UDDi.Max - 1 
    '判断是否在ID集合内 
    If TempID = IdDi(i) Then 
       '判断是否已经存在 
       ShiFouCZ = False 
       For j = 0 To TMcount - 1 
          If TempID = IdtempArr(j) Then 
            ShiFouCZ = True 
          End If 
       Next j 
       If ShiFouCZ = False Then 
            IdtempArr(TCount) = TempID 
            TCount = TCount + 1 
            '添加到frmshijuan.lsttm里 
            FrmShiJuan.LstTM.AddItem Trim(str(TempID)) + "(0)" 
       End If 
    End If 
  Next i 
 Loop 
 'Exit Sub 
  '产生低多 
 TMcount = Val(TXTdiD.Text) 
 ReDim IdtempArr(TMcount) As Long 
 TCount = 0 
 Do While TCount < TMcount 
  TempID = Round(Rnd * IdDiD(UDDiD.Max - 1)) + 1 
  For i = 0 To UDDiD.Max - 1 
    '判断是否在ID集合内 
    If TempID = IdDiD(i) Then 
       '判断是否已经存在 
       ShiFouCZ = False 
       For j = 0 To TMcount - 1 
          If TempID = IdtempArr(j) Then 
            ShiFouCZ = True 
          End If 
       Next j 
       If ShiFouCZ = False Then 
            IdtempArr(TCount) = TempID 
            TCount = TCount + 1 
            '添加到frmshijuan.lsttmd里 
            FrmShiJuan.LstTMD.AddItem Trim(str(TempID)) + "(0)" 
       End If 
    End If 
  Next i 
 Loop 
  
  '产生中单 
 TMcount = Val(TXTZhong.Text) 
 ReDim IdtempArr(TMcount) As Long 
 TCount = 0 
 Do While TCount < TMcount 
  TempID = Round(Rnd * IdZhong(UDZhong.Max - 1)) + 1 
  For i = 0 To UDZhong.Max - 1 
    '判断是否在ID集合内 
    If TempID = IdZhong(i) Then 
       '判断是否已经存在 
       ShiFouCZ = False 
       For j = 0 To TMcount - 1 
          If TempID = IdtempArr(j) Then 
            ShiFouCZ = True 
          End If 
       Next j 
       If ShiFouCZ = False Then 
            IdtempArr(TCount) = TempID 
            TCount = TCount + 1 
            '添加到frmshijuan.lsttm里 
            FrmShiJuan.LstTM.AddItem Trim(str(TempID)) + "(0)" 
       End If 
    End If 
  Next i 
 Loop 
  
   '产生中多 
 TMcount = Val(TXTZhongD.Text) 
 ReDim IdtempArr(TMcount) As Long 
 TCount = 0 
 Do While TCount < TMcount 
  TempID = Round(Rnd * IdZhongD(UDZhongD.Max - 1)) + 1 
  For i = 0 To UDZhongD.Max - 1 
    '判断是否在ID集合内 
    If TempID = IdZhongD(i) Then 
       '判断是否已经存在 
       ShiFouCZ = False 
       For j = 0 To TMcount - 1 
          If TempID = IdtempArr(j) Then 
            ShiFouCZ = True 
          End If 
       Next j 
       If ShiFouCZ = False Then 
            IdtempArr(TCount) = TempID 
            TCount = TCount + 1 
            '添加到frmshijuan.lsttmd里 
            FrmShiJuan.LstTMD.AddItem Trim(str(TempID)) + "(0)" 
       End If 
    End If 
  Next i 
 Loop 
  
  '产生高单 
 TMcount = Val(TXTGao.Text) 
 ReDim IdtempArr(TMcount) As Long 
 TCount = 0 
 Do While TCount < TMcount 
  TempID = Round(Rnd * IdGao(UDGao.Max - 1)) + 1 
  For i = 0 To UDGao.Max - 1 
    '判断是否在ID集合内 
    If TempID = IdGao(i) Then 
       '判断是否已经存在 
       ShiFouCZ = False 
       For j = 0 To TMcount - 1 
          If TempID = IdtempArr(j) Then 
            ShiFouCZ = True 
          End If 
       Next j 
       If ShiFouCZ = False Then 
            IdtempArr(TCount) = TempID 
            TCount = TCount + 1 
            '添加到frmshijuan.lsttm里 
            FrmShiJuan.LstTM.AddItem Trim(str(TempID)) + "(0)" 
       End If 
    End If 
  Next i 
 Loop 
  
   '产生高多 
 TMcount = Val(TXTGaoD.Text) 
 ReDim IdtempArr(TMcount) As Long 
 TCount = 0 
 Do While TCount < TMcount 
  TempID = Round(Rnd * IdGaoD(UDGaoD.Max - 1)) + 1 
  For i = 0 To UDGaoD.Max - 1 
    '判断是否在ID集合内 
    If TempID = IdGaoD(i) Then 
       '判断是否已经存在 
       ShiFouCZ = False 
       For j = 0 To TMcount - 1 
          If TempID = IdtempArr(j) Then 
            ShiFouCZ = True 
          End If 
       Next j 
       If ShiFouCZ = False Then 
            IdtempArr(TCount) = TempID 
            TCount = TCount + 1 
            '添加到frmshijuan.lsttmd里 
            FrmShiJuan.LstTMD.AddItem Trim(str(TempID)) + "(0)" 
       End If 
    End If 
  Next i 
 Loop 
  
 Unload Me 
End Sub 
 
Private Sub Form_Load() 
  Randomize '产生真正的随机数(rnd) 
 
  Dim adoRS As Recordset 
  Dim IdCount As Long 
  Set adoRS = New Recordset 
  '低单 
  adoRS.Open "select id from question where leibie='单' and nandu='低' and kemuid=" + Int2Str(UseKeMuID) + " and nianjiid=" + Int2Str(UseNianJiID) + " order by id", DB, adOpenStatic, adLockOptimistic 
  Rec2Arr adoRS, IdDi, IdCount 
  UDDi.Max = IdCount + 1 
  adoRS.Close 
   '低多 
  adoRS.Open "select id from question where leibie='多' and nandu='低' and kemuid=" + Int2Str(UseKeMuID) + " and nianjiid=" + Int2Str(UseNianJiID) + " order by id", DB, adOpenStatic, adLockOptimistic 
  Rec2Arr adoRS, IdDiD, IdCount 
  UDDiD.Max = IdCount + 1 
  adoRS.Close 
  '中单 
  adoRS.Open "select id from question where leibie='单' and nandu='中' and kemuid=" + Int2Str(UseKeMuID) + " and nianjiid=" + Int2Str(UseNianJiID) + " order by id", DB, adOpenStatic, adLockOptimistic 
  Rec2Arr adoRS, IdZhong, IdCount 
  UDZhong.Max = IdCount + 1 
  adoRS.Close 
  '中多 
  adoRS.Open "select id from question where leibie='多' and nandu='中' and kemuid=" + Int2Str(UseKeMuID) + " and nianjiid=" + Int2Str(UseNianJiID) + " order by id", DB, adOpenStatic, adLockOptimistic 
  Rec2Arr adoRS, IdZhongD, IdCount 
  UDZhongD.Max = IdCount + 1 
  adoRS.Close 
  '高单 
  adoRS.Open "select id from question where leibie='单' and nandu='高' and kemuid=" + Int2Str(UseKeMuID) + " and nianjiid=" + Int2Str(UseNianJiID) + " order by id", DB, adOpenStatic, adLockOptimistic 
  Rec2Arr adoRS, IdGao, IdCount 
  UDGao.Max = IdCount + 1 
  adoRS.Close 
  '高多 
  adoRS.Open "select id from question where leibie='多' and nandu='高' and kemuid=" + Int2Str(UseKeMuID) + " and nianjiid=" + Int2Str(UseNianJiID) + " order by id", DB, adOpenStatic, adLockOptimistic 
  Rec2Arr adoRS, IdGaoD, IdCount 
  UDGaoD.Max = IdCount + 1 
  adoRS.Close 
  Set adoRS = Nothing 
End Sub 
'根据记录返回数组ID 
Sub Rec2Arr(ByVal Rec As Recordset, IdArr() As Long, IdCount As Long) 
 '如果记录为空则退出 
 If Rec.RecordCount <= 0 Then 
   ReDim IdArr(0) 
   IdCount = -1 
   Exit Sub 
 End If 
  Rec.MoveFirst 
  Dim IdStr As String 
  Dim IdStrArr() As String 
  Dim i As Long 
  IdStr = "" 
  Do While Not Rec.EOF 
    IdStr = IdStr + Trim(str(Rec.Fields("id").Value)) + "," 
    Rec.MoveNext 
  Loop 
  IdStr = Left(IdStr, Len(IdStr) - 1) 
  IdStrArr = Split(IdStr, ",") 
  '重新定义 
  IdCount = UBound(IdStrArr) 
  ReDim IdArr(IdCount) 
  For i = 0 To IdCount 
     IdArr(i) = Val(IdStrArr(i)) 
  Next i 
   
End Sub