www.pudn.com > VBproject VCD.rar > MemberView.frm, change:2003-06-21,size:14067b


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 MemberView  
   Appearance      =   0  'Flat 
   Caption         =   "会员信息浏览" 
   ClientHeight    =   5850 
   ClientLeft      =   3210 
   ClientTop       =   3225 
   ClientWidth     =   9495 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   5850 
   ScaleWidth      =   9495 
   Begin XPCmd.xpcmdbutton CancelBT  
      Height          =   375 
      Left            =   7560 
      TabIndex        =   14 
      Top             =   3720 
      Width           =   1095 
      _ExtentX        =   1931 
      _ExtentY        =   661 
      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 MemberSearchGrid  
      Height          =   2535 
      Left            =   240 
      TabIndex        =   13 
      Top             =   840 
      Width           =   9015 
      _ExtentX        =   15901 
      _ExtentY        =   4471 
      _Version        =   393216 
      Cols            =   1 
      FixedCols       =   0 
      _NumberOfBands  =   1 
      _Band(0).Cols   =   1 
   End 
   Begin VB.ComboBox Combo1  
      Height          =   300 
      ItemData        =   "MemberView.frx":0000 
      Left            =   1920 
      List            =   "MemberView.frx":0022 
      TabIndex        =   12 
      Top             =   3720 
      Width           =   1215 
   End 
   Begin XPCmd.xpcmdbutton SearchBT  
      Height          =   375 
      Left            =   5880 
      TabIndex        =   10 
      Top             =   3720 
      Width           =   1095 
      _ExtentX        =   1931 
      _ExtentY        =   661 
      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            =   4320 
      TabIndex        =   8 
      Top             =   3680 
      Width           =   1095 
   End 
   Begin MSHierarchicalFlexGridLib.MSHFlexGrid MemberGrid  
      Bindings        =   "MemberView.frx":006A 
      Height          =   2535 
      Left            =   240 
      TabIndex        =   0 
      Top             =   840 
      Width           =   9015 
      _ExtentX        =   15901 
      _ExtentY        =   4471 
      _Version        =   393216 
      Cols            =   10 
      FixedCols       =   0 
      DataMember      =   "ComMember" 
      _NumberOfBands  =   1 
      _Band(0).Cols   =   10 
      _Band(0).GridLinesBand=   1 
      _Band(0).TextStyleBand=   0 
      _Band(0).TextStyleHeader=   0 
      _Band(0)._NumMapCols=   10 
      _Band(0)._MapCol(0)._Name=   "ID" 
      _Band(0)._MapCol(0)._RSIndex=   0 
      _Band(0)._MapCol(1)._Name=   "姓名" 
      _Band(0)._MapCol(1)._RSIndex=   1 
      _Band(0)._MapCol(2)._Name=   "年龄" 
      _Band(0)._MapCol(2)._RSIndex=   3 
      _Band(0)._MapCol(3)._Name=   "性别" 
      _Band(0)._MapCol(3)._RSIndex=   4 
      _Band(0)._MapCol(4)._Name=   "资金" 
      _Band(0)._MapCol(4)._RSIndex=   2 
      _Band(0)._MapCol(4)._Alignment=   7 
      _Band(0)._MapCol(5)._Name=   "电子邮件" 
      _Band(0)._MapCol(5)._RSIndex=   5 
      _Band(0)._MapCol(6)._Name=   "地址" 
      _Band(0)._MapCol(6)._RSIndex=   6 
      _Band(0)._MapCol(7)._Name=   "邮政编码" 
      _Band(0)._MapCol(7)._RSIndex=   7 
      _Band(0)._MapCol(8)._Name=   "电话" 
      _Band(0)._MapCol(8)._RSIndex=   8 
      _Band(0)._MapCol(9)._Name=   "身份证号码" 
      _Band(0)._MapCol(9)._RSIndex=   9 
   End 
   Begin VB.Frame Frame1  
      Height          =   1095 
      Left            =   600 
      TabIndex        =   2 
      Top             =   4440 
      Width           =   8295 
      Begin XPCmd.xpcmdbutton RefreshBT  
         Height          =   495 
         Left            =   5280 
         TabIndex        =   3 
         Top             =   360 
         Width           =   1095 
         _ExtentX        =   1931 
         _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 Exit  
         Height          =   495 
         Left            =   6960 
         TabIndex        =   4 
         Top             =   360 
         Width           =   1095 
         _ExtentX        =   1931 
         _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 Memberdetel  
         Height          =   495 
         Left            =   3600 
         TabIndex        =   5 
         Top             =   360 
         Width           =   1095 
         _ExtentX        =   1931 
         _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 MemberEdit  
         Height          =   495 
         Left            =   1920 
         TabIndex        =   6 
         Top             =   360 
         Width           =   1095 
         _ExtentX        =   1931 
         _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 MemberAdd  
         Height          =   495 
         Left            =   240 
         TabIndex        =   7 
         Top             =   360 
         Width           =   1095 
         _ExtentX        =   1931 
         _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 
   End 
   Begin VB.Label Label3  
      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            =   840 
      TabIndex        =   11 
      Top             =   3720 
      Width           =   960 
   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            =   3480 
      TabIndex        =   9 
      Top             =   3720 
      Width           =   720 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      Caption         =   "会员信息总览" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   15 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF0000& 
      Height          =   300 
      Left            =   3480 
      TabIndex        =   1 
      Top             =   240 
      Width           =   1800 
   End 
End 
Attribute VB_Name = "MemberView" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim rows, id, tablename, SKey, SDepend, SSelect As String 
Dim com As Command 
Dim rst As Recordset 
 
Private Sub CancelBT_Click() 
MemberGrid.Visible = True 
MemberSearchGrid.Visible = False 
End Sub 
 
Private Sub Exit_Click() 
Unload Me 
VCDView.SetFocus 
End Sub 
 
Private Sub Form_Load() 
Set rst = New Recordset 
Set com = New Command 
On Error GoTo err 
rst.Open "select * from member", con, adOpenDynamic, adLockBatchOptimistic 
If rst.EOF = True Then 
   MsgBox "会员信息表为空!没有任何会员信息!" 
End If 
rst.Close 
MemberGrid.Visible = True 
MemberSearchGrid.Visible = False 
With MemberGrid 
     .ColWidth(0) = 550 
     .ColWidth(1) = 800 
     .ColWidth(2) = 500 
     .ColWidth(3) = 500 
     .ColWidth(4) = 800 
     .ColWidth(5) = 1800 
     .ColWidth(6) = 2500 
     .ColWidth(7) = 800 
     .ColWidth(8) = 1200 
     .ColWidth(9) = 1800 
End With 
With MemberSearchGrid 
     .ColWidth(0) = 550 
     .ColWidth(1) = 800 
     .ColWidth(2) = 500 
     .ColWidth(3) = 500 
     .ColWidth(4) = 800 
     .ColWidth(5) = 1800 
     .ColWidth(6) = 2500 
     .ColWidth(7) = 800 
     .ColWidth(8) = 1200 
     .ColWidth(9) = 1800 
End With 
Exit Sub 
err: 
MsgBox "数据库未连接!" 
Unload Me 
'VCDMS.Show 
End Sub 
 
Private Sub MemberAdd_Click() 
MemberRE.Show 
End Sub 
 
Private Sub Memberdetel_Click() 
'MsgBox tableName 
MsgBox id 
'MsgBox "00" & id + 1 
Dim a As Integer 
a = MsgBox("确定要删除第" & id & "条记录吗?!", vbYesNo, "提示信息") 
If a = 6 Then 
'On Error GoTo err 
MsgBox "123465" 
   com.ActiveConnection = con 
   rst.Open "select * from member", con, adOpenDynamic, adLockBatchOptimistic 
   rst.Move (id) 
   rst.Delete 
   MsgBox "deldeldeldel" 
   rst.Close 
   MemberData.rsComMember.Requery 
   Set MemberGrid.DataSource = MemberData 
Else 
   rst.Close 
   MemberView.Show 
End If 
Exit Sub 
err: 
MsgBox err.Description 
End Sub 
 
Private Sub MemberEdit_Click() 
MemberEditer.ReceiveID (id) 
MemberEditer.Show 
'MemberEdit.SetFocus 
End Sub 
 
Private Sub MemberGrid_Click() 
rows = MemberGrid.Row 
id = "00" & VCDAdd.getid(rows - 1) 
'MsgBox id 
MemberEditer.ReceiveID (id) 
'On Error GoTo err 
'com.ActiveConnection = con 
'rst.Open "select * from member", con, adOpenDynamic, adLockBatchOptimistic 
'rst.Move (id) 
'rst.Close 
'MemberEditer.Show 
Exit Sub 
err: 
MsgBox err.Description 
End Sub 
 
Private Sub RefreshBT_Click() 
'rst.Open 
MemberData.rsComMember.Requery 
Set MemberGrid.DataSource = MemberData 
'rst.Close 
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) 
   MemberGrid.Visible = False 
   MemberSearchGrid.Visible = True 
   Select Case SSelect 
          Case "ID" 
          SDepend = "cmemberid" 
          Case "姓名" 
          SDepend = "cmembername" 
          Case "年龄" 
          SDepend = "cage" 
          Case "性别" 
          SDepend = "csex" 
          Case "资金" 
          SDepend = "mmoney" 
          Case "电子邮件" 
          SDepend = "cemail" 
          Case "地址" 
          SDepend = "caddress" 
          Case "邮政编码" 
          SDepend = "cpostcode" 
          Case "电话" 
          SDepend = "cphone" 
          Case "身份证号码" 
          SDepend = "ccardnum" 
   End Select 
   rst.Open "select 'ID'=cmemberid,'姓名'=cmembername,'年龄'=cage,'性别'=csex,'资金'=mmoney,'电子邮件'=cemail,'地址'=caddress,'邮政编码'=cpostcode,'电话'=cphone,'身份证号码'=ccardnum from member where " & SDepend & " like '%" & Trim(SKey) & "%'", con, adOpenDynamic, adLockBatchOptimistic 
   Set MemberSearchGrid.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