www.pudn.com > opy_LMS.rar > frmIssueRpt.frm


VERSION 5.00 
Begin VB.Form frmIssueRpt  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "读者借-还报表" 
   ClientHeight    =   1575 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   5325 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MDIChild        =   -1  'True 
   MinButton       =   0   'False 
   ScaleHeight     =   1575 
   ScaleWidth      =   5325 
   Begin VB.Frame Frame1  
      Height          =   1215 
      Left            =   120 
      TabIndex        =   0 
      Top             =   270 
      Width           =   5055 
      Begin VB.TextBox txt_memid  
         Height          =   285 
         Left            =   1440 
         MaxLength       =   6 
         TabIndex        =   3 
         Top             =   720 
         Width           =   1695 
      End 
      Begin VB.CommandButton Command1  
         Height          =   495 
         Left            =   3720 
         MouseIcon       =   "frmIssueRpt.frx":0000 
         MousePointer    =   99  'Custom 
         Picture         =   "frmIssueRpt.frx":0152 
         Style           =   1  'Graphical 
         TabIndex        =   2 
         Top             =   240 
         Width           =   1215 
      End 
      Begin VB.ComboBox Combo1  
         Height          =   300 
         ItemData        =   "frmIssueRpt.frx":05DD 
         Left            =   1440 
         List            =   "frmIssueRpt.frx":05E7 
         TabIndex        =   1 
         Top             =   240 
         Width           =   2055 
      End 
      Begin VB.Label Label4  
         Alignment       =   2  'Center 
         BackStyle       =   0  'Transparent 
         Caption         =   "显示" 
         Height          =   255 
         Left            =   3720 
         TabIndex        =   6 
         Top             =   795 
         Width           =   1215 
      End 
      Begin VB.Label Label3  
         BackColor       =   &H00C8D0D4& 
         BackStyle       =   0  'Transparent 
         Caption         =   "借书证号" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9.75 
            Charset         =   0 
            Weight          =   700 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00800000& 
         Height          =   255 
         Left            =   120 
         TabIndex        =   5 
         Top             =   720 
         Width           =   1095 
      End 
      Begin VB.Label Label1  
         BackStyle       =   0  'Transparent 
         Caption         =   "读者" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9.75 
            Charset         =   0 
            Weight          =   700 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00800000& 
         Height          =   255 
         Left            =   120 
         TabIndex        =   4 
         Top             =   240 
         Width           =   1095 
      End 
   End 
   Begin VB.Label Label2  
      BackStyle       =   0  'Transparent 
      Caption         =   "选择特定的读者" 
      Height          =   255 
      Left            =   120 
      TabIndex        =   7 
      Top             =   30 
      Width           =   4575 
   End 
End 
Attribute VB_Name = "frmIssueRpt" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim rs As ADODB.Recordset 
Dim db As ADODB.Connection 
Dim status As Boolean 
Dim str As String 
Private Sub Combo1_Click() 
If (Combo1.Text = "借书证号") Then 
txt_memid.Locked = False 
ElseIf (Combo1.Text = "所有") Then 
txt_memid.Locked = True 
End If 
txt_memid.Text = "" 
End Sub 
Private Sub Command1_Click() 
If (Combo1.Text <> "借书证号" And Combo1.Text <> "所有") Then 
 MsgBox "请选择适当的读者选项.", vbCritical, "错误信息" 
Exit Sub 
End If 
If (Combo1.Text = "借书证号") Then 
    If (txt_memid.Text <> "") Then 
        If IsNumeric(txt_memid.Text) Then 
        str = "select * from Issue where Memid=" & txt_memid.Text 
        Else 
        MsgBox "请输入为数字的借书证号.", vbCritical, "错误信息" 
        Exit Sub 
        End If 
    Else 
    MsgBox "请输入借书证号.", vbCritical, "错误信息" 
    Exit Sub 
    End If 
Else 
str = "select * from Issue" 
End If 
 
again: 
If (status = False) Then 
rs.Open str, db, adOpenStatic, adLockOptimistic 
status = True 
Else 
rs.Close 
status = False 
GoTo again 
End If 
 
Set RptBookIR.DataSource = rs 
RptBookIR.Show vbModal 
 
End Sub 
 
Private Sub Form_Load() 
status = False 
 
Set rs = New ADODB.Recordset 
Set rs1 = New ADODB.Recordset 
Set db = New ADODB.Connection 
db.CursorLocation = adUseClient 
db.ConnectionString = "DSN=library;UID=sa;PWD=;" 
db.Open 
End Sub