www.pudn.com > VBproject VCD.rar > MemberEdit.frm, change:2003-06-15,size:22407b


VERSION 5.00 
Object = "{8ED8CCC1-8472-46D0-93E7-F66929B98442}#2.0#0"; "XPCMD.OCX" 
Begin VB.Form MemberEditer  
   Caption         =   "会员信息编辑" 
   ClientHeight    =   8385 
   ClientLeft      =   4590 
   ClientTop       =   1575 
   ClientWidth     =   7410 
   LinkTopic       =   "Form1" 
   ScaleHeight     =   8385 
   ScaleWidth      =   7410 
   Begin XPCmd.xpcmdbutton CancelBT  
      Height          =   495 
      Left            =   5160 
      TabIndex        =   16 
      Top             =   7440 
      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 ClearBT  
      Height          =   495 
      Left            =   3120 
      TabIndex        =   15 
      Top             =   7440 
      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 SureBT  
      Height          =   495 
      Left            =   960 
      TabIndex        =   14 
      Top             =   7440 
      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 Last  
      Height          =   495 
      Left            =   5760 
      TabIndex        =   13 
      Top             =   6600 
      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 Previours  
      Height          =   495 
      Left            =   3960 
      TabIndex        =   12 
      Top             =   6600 
      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 Next  
      Height          =   495 
      Left            =   2160 
      TabIndex        =   11 
      Top             =   6600 
      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 First  
      Height          =   495 
      Left            =   480 
      TabIndex        =   10 
      Top             =   6600 
      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 TID  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      Locked          =   -1  'True 
      TabIndex        =   0 
      TabStop         =   0   'False 
      Top             =   840 
      Width           =   1335 
   End 
   Begin VB.TextBox Tname  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   1 
      Top             =   1440 
      Width           =   1335 
   End 
   Begin VB.TextBox TAge  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   2 
      Top             =   2040 
      Width           =   735 
   End 
   Begin VB.ComboBox ComboSex  
      Height          =   300 
      ItemData        =   "MemberEdit.frx":0000 
      Left            =   2520 
      List            =   "MemberEdit.frx":000A 
      TabIndex        =   3 
      Top             =   2640 
      Width           =   1335 
   End 
   Begin VB.TextBox TEmail  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   4 
      Top             =   3120 
      Width           =   1935 
   End 
   Begin VB.TextBox TPhone  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   5 
      Top             =   3720 
      Width           =   1695 
   End 
   Begin VB.TextBox TAddress  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   7 
      Top             =   4920 
      Width           =   3855 
   End 
   Begin VB.TextBox TPostcode  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   8 
      Top             =   5520 
      Width           =   1215 
   End 
   Begin VB.TextBox TCardnum  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   2520 
      TabIndex        =   6 
      Top             =   4320 
      Width           =   2295 
   End 
   Begin VB.Frame Frame1  
      Height          =   5655 
      Left            =   240 
      TabIndex        =   18 
      Top             =   480 
      Width           =   6975 
      Begin VB.TextBox TMoney  
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   12 
            Charset         =   134 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   375 
         Left            =   5160 
         TabIndex        =   9 
         Top             =   5040 
         Width           =   975 
      End 
      Begin VB.Label Label11  
         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            =   3960 
         TabIndex        =   29 
         Top             =   5100 
         Width           =   960 
      End 
      Begin VB.Label Label10  
         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            =   720 
         TabIndex        =   27 
         Top             =   3880 
         Width           =   1200 
      End 
      Begin VB.Label Label8  
         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            =   1080 
         TabIndex        =   26 
         Top             =   5100 
         Width           =   480 
      End 
      Begin VB.Label Label7  
         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        =   25 
         Top             =   4490 
         Width           =   960 
      End 
      Begin VB.Label Label6  
         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            =   1080 
         TabIndex        =   24 
         Top             =   3260 
         Width           =   480 
      End 
      Begin VB.Label Label5  
         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        =   23 
         Top             =   2720 
         Width           =   960 
      End 
      Begin VB.Label Label4  
         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            =   1080 
         TabIndex        =   22 
         Top             =   2200 
         Width           =   480 
      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            =   1080 
         TabIndex        =   21 
         Top             =   1600 
         Width           =   480 
      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            =   1080 
         TabIndex        =   20 
         Top             =   1000 
         Width           =   480 
      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            =   840 
         TabIndex        =   19 
         Top             =   400 
         Width           =   960 
      End 
   End 
   Begin VB.Frame Frame2  
      Height          =   1695 
      Left            =   240 
      TabIndex        =   28 
      Top             =   6360 
      Width           =   6975 
   End 
   Begin VB.Label Label9  
      AutoSize        =   -1  'True 
      Caption         =   "会员信息修改" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   15 
         Charset         =   134 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00FF00FF& 
      Height          =   300 
      Left            =   2520 
      TabIndex        =   17 
      Top             =   120 
      Width           =   1800 
   End 
End 
Attribute VB_Name = "MemberEditer" 
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 id As String 
 
Private Sub CancelBT_Click() 
'rst.Open 
'rst.CancelUpdate 
'rst.Close 
Unload Me 
End Sub 
 
Private Sub ClearBT_Click() 
For Each Control In MemberEdit 
    If TypeOf Control Is TextBox Then 
      If Control <> TID Then 
        Control.Text = "" 
      End If 
    End If 
Next 
End Sub 
 
Private Sub First_Click() 
rst.Open 
rst.MoveFirst 
DetailsShow 
'Previours.Enabled = False 
End Sub 
 
Private Sub Form_Load() 
Set com = New Command 
Set rst = New Recordset 
 
'On Error GoTo err 
MsgBox id 
If id = "" Then 
    'MsgBox "空" 
    On Error GoTo err 
    rst.Open "select * from member", con, adOpenDynamic, adLockBatchOptimistic 
    DetailsShow 
Else 
    'MsgBox "id" 
    On Error GoTo err 
    rst.Open "select * from member where cmemberid = '" & id & "'", con, adOpenDynamic, adLockBatchOptimistic 
    DetailsShow 
'rst.Close 
End If 
Exit Sub 
err: 
MsgBox "数据库没有连接!请连接!" 
'VCDMS.Show 
Unload Me 
End Sub 
 
 
Public Sub DetailsShow() 
If rst.EOF Then 
   MsgBox "会员信息表为空!没有任何会员信息!" 
   rst.Close 
Else 
    TID.Text = rst!cMemberID 
    Tname.Text = rst!cMemberName 
    TAge.Text = rst!cage 
    ComboSex.Text = rst!cSex 
    TEmail.Text = rst!cEmail 
    TPhone.Text = rst!cPhone 
    TCardnum.Text = rst!cCardnum 
    TAddress.Text = rst!cAddress 
    TPostcode.Text = rst!cPostcode 
    TMoney.Text = rst!mMoney 
    rst.Close 
End If 
End Sub 
 
Private Sub Last_Click() 
rst.Open 
rst.MoveLast 
DetailsShow 
End Sub 
 
Private Sub Next_Click() 
rst.Open 
rst.MoveNext 
If rst.EOF = True Then 
   rst.MoveLast 
End If 
DetailsShow 
End Sub 
 
Private Sub Previours_Click() 
rst.Open 
rst.MovePrevious 
If rst.BOF = True Then 
   rst.MoveFirst 
End If 
DetailsShow 
End Sub 
 
Private Sub SureBT_Click() 
For Each Control In MemberEditer 
    If TypeOf Control Is TextBox Then 
     If Control <> TID Then 
        If Trim(Control.Text) = "" Then 
            MsgBox "请输入完整信息" 
            Exit Sub 
        End If 
      End If 
    End If 
Next 
 
If Len(Tname.Text) > 15 Then 
    MsgBox "姓名过长!请检查!" 
    Tname.SetFocus 
    Exit Sub 
End If 
If Asc(Trim(TAge.Text)) > 57 Or Asc(Trim(TAge.Text)) < 48 Then 
   MsgBox "您的年龄有问题!请输入数字!" 
   TAge.SetFocus 
   Exit Sub 
   ElseIf Len(Trim(TAge.Text)) > 3 Then 
           MsgBox "您的年龄有那么大嘛!请检查!" 
           TAge.SetFocus 
           Exit Sub 
   ElseIf Trim(TAge.Text) = 0 Then 
           MsgBox "0岁的您也能看电影嘛!" 
           TAge.SetFocus 
    Exit Sub 
End If 
If ComboSex.Text = "" Then 
   MsgBox "请选择您的性别!" 
   ComboSex.SetFocus 
   Exit Sub 
End If 
If Len(Trim(TEmail.Text)) > 30 Then 
    MsgBox "电子邮件过长!请检查!" 
    TEmail.SetFocus 
    Exit Sub 
End If 
 
If MemberRE.checkemail(TEmail.Text) = 0 Then 
    MsgBox "电子邮件输入有误!请检查!" 
    TEmail.SetFocus 
    Exit Sub 
End If 
 
If Asc(Trim(TPhone.Text)) > 57 Or Asc(Trim(TPhone.Text)) < 48 Then 
    MsgBox "电话号码有误!请输入数字!" 
    TPhone.SetFocus 
    Exit Sub 
    ElseIf Len(Trim(TPhone.Text)) > 13 Or Len(Trim(TPhone.Text)) < 8 Then 
            MsgBox "电话号码有误!请检查!" 
            TPhone.SetFocus 
    Exit Sub 
End If 
If Asc(Trim(TCardnum.Text)) > 57 Or Asc(Trim(TCardnum.Text)) < 48 Then 
    MsgBox "身份证号码有误!请输入数字!" 
    TCardnum.SetFocus 
    Exit Sub 
    ElseIf Len(Trim(TCardnum.Text)) > 18 Or Len(Trim(TCardnum.Text)) < 15 Then 
            MsgBox "身份证号码有误!请检查!" 
            TCardnum.SetFocus 
    Exit Sub 
End If 
If Asc(Trim(TPostcode.Text)) > 57 Or Asc(Trim(TPostcode.Text)) < 48 Then 
    MsgBox "邮政编码有误!请输入数字!" 
    TPostcode.SetFocus 
    Exit Sub 
    ElseIf Len(Trim(TPostcode.Text)) > 6 Then 
            MsgBox "邮编过长!请检查!" 
            TPostcode.SetFocus 
    Exit Sub 
     
End If 
 
Dim id, name, money, age, sex, email, address, postcode, phone, cardnum As String 
 
id = TID.Text 
name = Tname.Text 
age = TAge.Text 
sex = ComboSex.Text 
email = TEmail.Text 
address = TAddress.Text 
postcode = TPostcode.Text 
phone = TPhone.Text 
cardnum = TCardnum.Text 
money = TMoney.Text 
'On Error GoTo err 
'com.ActiveConnection = con 
rst.Open "update Member set cmembername='" & name & "',mMoney=" & money & ",cage='" & age & "',csex='" & sex & "',cemail='" & email & "',caddress='" & _ 
address & "',cpostcode='" & postcode & "',cphone='" & phone & "',ccardnum='" & cardnum & "' where cmemberid= " & id & "", con, adOpenDynamic, adLockOptimistic 
MsgBox "您的信息修改成功!:)" 
 
'rst.Close 
Unload Me 
Exit Sub 
err: 
MsgBox "请确认数据库是否连接!" 
End Sub 
 
Public Function ReceiveID(receid As String) 
id = receid 
MsgBox id 
End Function