www.pudn.com > VBproject VCD.rar > OdrderView.frm, change:2003-06-18,size:7807b


VERSION 5.00 
Object = "{8ED8CCC1-8472-46D0-93E7-F66929B98442}#2.0#0"; "XPCMD.OCX" 
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX" 
Begin VB.Form OrderView  
   Caption         =   "租借信息浏览" 
   ClientHeight    =   5805 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   9300 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   5805 
   ScaleWidth      =   9300 
   StartUpPosition =   3  '窗口缺省 
   Begin XPCmd.xpcmdbutton ExitBT  
      Height          =   495 
      Left            =   6720 
      TabIndex        =   8 
      Top             =   4920 
      Width           =   1215 
      _ExtentX        =   2143 
      _ExtentY        =   873 
      Caption         =   "   离  开" 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   9 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
   End 
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid OrderViewGrid  
      Height          =   3015 
      Left            =   600 
      TabIndex        =   7 
      Top             =   600 
      Width           =   8055 
      _ExtentX        =   14208 
      _ExtentY        =   5318 
      _Version        =   393216 
      Cols            =   1 
      FixedCols       =   0 
      _NumberOfBands  =   1 
      _Band(0).Cols   =   1 
   End 
   Begin VB.ComboBox Combo1  
      Height          =   300 
      ItemData        =   "OdrderView.frx":0000 
      Left            =   3000 
      List            =   "OdrderView.frx":001F 
      TabIndex        =   6 
      Top             =   4200 
      Width           =   1215 
   End 
   Begin XPCmd.xpcmdbutton CancelBT  
      Height          =   495 
      Left            =   4080 
      TabIndex        =   5 
      Top             =   4920 
      Width           =   1215 
      _ExtentX        =   2143 
      _ExtentY        =   873 
      Caption         =   "   取  消" 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   9 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
   End 
   Begin XPCmd.xpcmdbutton SearchBT  
      Height          =   495 
      Left            =   1440 
      TabIndex        =   4 
      Top             =   4920 
      Width           =   1215 
      _ExtentX        =   2143 
      _ExtentY        =   873 
      Caption         =   "   查  找" 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}  
         Name            =   "宋体" 
         Size            =   9 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
   End 
   Begin VB.TextBox Text1  
      Height          =   375 
      Left            =   5640 
      TabIndex        =   2 
      Top             =   4120 
      Width           =   1335 
   End 
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid OrdersSearchGrid  
      Height          =   3015 
      Left            =   600 
      TabIndex        =   0 
      Top             =   600 
      Width           =   8055 
      _ExtentX        =   14208 
      _ExtentY        =   5318 
      _Version        =   393216 
      Cols            =   1 
      FixedCols       =   0 
      _NumberOfBands  =   1 
      _Band(0).Cols   =   1 
   End 
   Begin VB.Label Label2  
      AutoSize        =   -1  'True 
      Caption         =   "关键字" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   240 
      Left            =   4800 
      TabIndex        =   3 
      Top             =   4200 
      Width           =   720 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      Caption         =   "查询依据" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   240 
      Left            =   1920 
      TabIndex        =   1 
      Top             =   4200 
      Width           =   960 
   End 
End 
Attribute VB_Name = "OrderView" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim com As Command 
Dim rst As Recordset 
Dim SSelect, SKey, SDepend As String 
 
Private Sub CancelBT_Click() 
OrdersSearchGrid.Visible = False 
OrderViewGrid.Visible = True 
End Sub 
 
Private Sub ExitBT_Click() 
Unload Me 
 
End Sub 
 
Private Sub Form_Load() 
Set com = New Command 
Set rst = New Recordset 
com.ActiveConnection = con 
'rst.Open "" 
OrdersSearchGrid.Visible = False 
OrderViewGrid.Visible = True 
'OrderViewData.rsComOrderView.Requery 
Set OrderViewGrid.DataSource = OrderViewData 
With OrderViewGrid 
     .ColWidth(0) = 800 
     .ColWidth(1) = 800 
     .ColWidth(2) = 2000 
     .ColWidth(3) = 800 
     .ColWidth(4) = 500 
     .ColWidth(5) = 1000 
     .ColWidth(6) = 1000 
     .ColWidth(7) = 1050 
     .ColWidth(8) = 450 
End With 
End Sub 
 
Private Sub SearchBT_Click() 
If Combo1.Text = "" Then 
   MsgBox "请选择查询依据!" 
ElseIf Text1.Text = "" Then 
   MsgBox "请输入查询关键字!" 
   Text1.SetFocus 
Else 
   SSelect = Combo1.Text 
   SKey = Trim(Text1.Text) 
   OrderViewGrid.Visible = False 
   OrdersSearchGrid.Visible = True 
   With OrdersSearchGrid 
     .ColWidth(0) = 800 
     .ColWidth(1) = 800 
     .ColWidth(2) = 2000 
     .ColWidth(3) = 800 
     .ColWidth(4) = 500 
     .ColWidth(5) = 1000 
     .ColWidth(6) = 1000 
     .ColWidth(7) = 1050 
     .ColWidth(8) = 450 
   End With 
 
   Select Case SSelect 
          Case "租借ID" 
          SDepend = "corderno" 
          Case "会员ID" 
          SDepend = "cmemberID" 
          Case "影片名称" 
          SDepend = "cvcdname" 
          Case "影片类型" 
          SDepend = "ctype" 
          Case "数量" 
          SDepend = "irentnum" 
          Case "租借日期" 
          SDepend = "dorderdate" 
          Case "应归还日期" 
          SDepend = "dcreturndate" 
          Case "实际归还日期" 
          SDepend = "dfreturndate" 
          Case "租金" 
          SDepend = "irental" 
   End Select 
   rst.Open "select '租借ID'=corderno,'会员ID'=cmemberid,'影片名称'=cvcdname,'影片类型'=ctype,'数量'=irentnum,'租借日期'=dorderdate,'应归还日期'=dcreturndate,'实际归还日期'=dfreturndate,'租金'=irental from orders where " & SDepend & " like '%" & Trim(SKey) & "%'", con, adOpenDynamic, adLockBatchOptimistic 
   Set OrdersSearchGrid.DataSource = rst 
   On Error GoTo err 
   rst.MoveFirst 
   If rst.EOF = True Then 
      a = MsgBox("对不起!找不到您要的租借信息!!", vbInformation, "系统提示") = vbOK 
      rst.Close 
      'MsgBox "cllosed!" 
      'Exit Sub 
   Else 
      rst.Close 
   End If 
End If 
Exit Sub 
err: 
b = MsgBox("对不起!找不到您要的租借信息!!", vbInformation, "系统提示") = vbOK 
rst.Close 
End Sub