Private Sub xpcmdbutton1_Click()  '点击“确定”按钮
On Error GoTo over  con.Open
  rs.CursorLocation = 3
  rs.Open "select * from 密码验证", con, 1, 3
  
  If Trim(Text2) = "" And Trim(Text3) = "" Then
               
     MsgBox " 密码不能为空", , "友情提示"
     Text2.SetFocus
     rs.Close
     con.Close
     Exit Sub
  End If
  
 
  If rs.EOF <> True Then
     rs.MoveFirst
  End IfIf Trim(Text1.Text) <> frmindex.Label14.Caption Then GoTo Chang1 If Trim(Text2.Text) <> Trim(Text3.Text) Then GoTo Chang2       Do While Not rs.EOF
           
           If Trim(rs.Fields("user")) = frmindex.Label11.Caption And Trim(rs.Fields("password")) = Trim(Text1.Text) Then
              
               rs.Fields("password") = Trim(Text3.Text)
               
               rs.Update
               
               frmindex.Label14.Caption = Trim(Text3.Text)
               
                MsgBox " 密码修改成功", , "友情提示"
               rs.Close
               con.Close
               Unload Me
               Exit Sub
           End If
           rs.MoveNext
        Loop
        
   
Chang1:  MsgBox " 原始密码不正确", , "友情提示"
         Text1.SetFocus
         rs.Close
         con.Close
         Exit Sub
Chang2:  MsgBox "更改的密码不一致", , "友情提示"
         Text2.SetFocus
         rs.Close
         con.Close
         Exit Sub
over:
       MsgBox "数据库操作出现错误,请重新安装程序", , "友情提示"
End Sub
-----------------------------------------------------------------------------------------------------------------------------
Private Sub Form_Load()    Label7.Caption = Now
    Combo2.Enabled = False
    Combo1.Enabled = False
    Text1.Enabled = False
    Text2.Enabled = False
    Check1.Value = 2    xpcmdbutton7.Enabled = False
   
    Picture82.Visible = False    DTPicker2.Value = Date
    DTPicker3.Value = Date
    
    Me.DTPicker1.Format = dtpCustom
    Me.DTPicker1.CustomFormat = "yyyy-MM-dd hh:mm:ss"
    Me.DTPicker1.Value = Now    moldWidth% = Me.Width
    moldHeight% = Me.Height
        Dim lngCycVar As Long    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2    For lngCycVar = 0 To MenuHeader.Count - 1        MenuHeader(lngCycVar).Picture = img1.Picture
        MenuHeader(lngCycVar).Height = img1.Height
        MenuHeader(lngCycVar).Width = picNavigationFrame(lngCycVar).Width    Next    Call ResizeInit(Me)
    Call CornerEdit
    Call connetEnd Sub
-------------------------------------------------------------------------------------------------------------------------------
Private Sub Form_Resize()    On Error Resume Next
    Call ResizeForm(Me)    If WindowState <> vbMinimized Then        If Me.Width < 9000 Then            Me.Width = 9000        End If        If Me.Height < 5445 Then      '5445            Me.Height = 5445        End If        imgCorner(1).Left = Me.Width - 105
        imgCorner(2).Top = Me.Height - 105
        imgCorner(3).Left = Me.Width - 105
        imgCorner(3).Top = Me.Height - 105        imgBorder(1).Left = Me.Width - 45
        imgBorder(2).Top = Me.Height - 45        imgTitleButton(0).Left = Me.Width - 930
        imgTitleButton(1).Left = Me.Width - 630
        imgTitleButton(2).Left = Me.Width - 330        lblTitle.Width = Me.Width - 345    End If    If WindowState <> vbMinimized Then        LastState = WindowState
        Call CornerEdit    End If    Select Case WindowState        Case vbMinimized        AddToTray Me, frmMenu.RightMenu
        SetTrayTip "水泥微机配料系统"
        Me.Visible = False        Case vbMaximized        RemoveFromTray        Case vbNormal        RemoveFromTray    End Select
    If WindowState = vbMinimized Or WindowState = vbMaximized Then Exit Sub    Me.Height = moldHeight%
    Me.Width = moldWidth%    Exit SubEnd Sub
---------------------------------------------------------------------------------------------------------------------------

解决方案 »

  1.   

    你这花钱请人做的吧?既然这样就叫他给你解释清楚吧。
    答辩老师根本不会问你具体代码的,没必要操这个心呀。
    我们答辩的时候,班里一个同学做五子棋,找人买的代码,那个人把算法封在一个OCX里面,把同学给蒙了,结果当天就要答辩了,那个同学拿着叫我给他解释代码,我跟他说代码封起来了,他说封起来了怎么用,你不想帮我就算了……
      

  2.   

     If Adodc1.Recordset.EOF <> True Then
            Adodc1.Recordset.MoveFirst
       End If
       
       Do While Not Adodc1.Recordset.EOF
                  Set itmX = ListView1.ListItems.Add(, "K_" & Adodc1.Recordset.Fields("id").Value, Adodc1.Recordset.Fields(1).Value)
                For i = 2 To Adodc1.Recordset.Fields.Count - 1
                    If Not IsNull(Adodc1.Recordset.Fields(i).Value) Then
                        itmX.SubItems(i - 1) = Adodc1.Recordset.Fields(i).Value
                    End If
                Next i
        Adodc1.Recordset.MoveNext
        Loop
    那这几句是什么意思?这个不多了吧。谢谢了
      

  3.   

    把数据库某个表里的内容导出到ListView1里面显示出来
      

  4.   

    If Adodc1.Recordset.EOF <> True Then
            Adodc1.Recordset.MoveFirst
        End If
        
        Do While Not Adodc1.Recordset.EOF
               
            If Trim(Adodc1.Recordset.Fields(1)) = Trim(Text1.Text) Then
               GoTo over
            End If
            Adodc1.Recordset.MoveNext
        Loop
        
        With Adodc1.Recordset
        .AddNew
        .Fields(1) = Trim(Text1.Text)
    ----------------------------------------------
    If ListView1.ListItems.Count = 0 Then
          Exit Sub
       End If
       Set itmX = ListView1.SelectedItem
       Adodc1.Recordset.MoveFirst
      
       With Adodc1.Recordset
            .Find "id=" & Mid(itmX.Key, 3)
             Text1.Text = .Fields(1)
      

  5.   

    Private Sub xpcmdbutton1_Click()  '点击“确定”按钮 
    On Error GoTo over   con.Open 
      rs.CursorLocation = 3 
      rs.Open "select * from 密码验证", con, 1, 3 
      
      If Trim(Text2) = "" And Trim(Text3) = "" Then 
                  
        MsgBox " 密码不能为空", , "友情提示" 
        Text2.SetFocus 
        rs.Close 
        con.Close 
        Exit Sub 
      End If 
        If rs.EOF <> True Then 
        rs.MoveFirst 
      End If If Trim(Text1.Text) <> frmindex.Label14.Caption Then GoTo Chang1 If Trim(Text2.Text) <> Trim(Text3.Text) Then GoTo Chang2       Do While Not rs.EOF 
              
              If Trim(rs.Fields("user")) = frmindex.Label11.Caption And Trim(rs.Fields("password")) = Trim(Text1.Text) Then 
                  
                  rs.Fields("password") = Trim(Text3.Text) 
                  
                  rs.Update 
                  
                  frmindex.Label14.Caption = Trim(Text3.Text) 
                  
                    MsgBox " 密码修改成功", , "友情提示" 
                  rs.Close 
                  con.Close 
                  Unload Me 
                  Exit Sub 
              End If 
              rs.MoveNext 
            Loop 
            
      
    Chang1:  MsgBox " 原始密码不正确", , "友情提示" 
            Text1.SetFocus 
            rs.Close 
            con.Close 
            Exit Sub 
    Chang2:  MsgBox "更改的密码不一致", , "友情提示" 
            Text2.SetFocus 
            rs.Close 
            con.Close 
            Exit Sub 
    over: 
          MsgBox "数据库操作出现错误,请重新安装程序", , "友情提示" 
    End Sub 
    ---------------------
    这一段实现修改密码的功能
      

  6.   

    Private Sub Form_Load()     Label7.Caption = Now 
        Combo2.Enabled = False 
        Combo1.Enabled = False 
        Text1.Enabled = False 
        Text2.Enabled = False 
        Check1.Value = 2     xpcmdbutton7.Enabled = False 
      
        Picture82.Visible = False     DTPicker2.Value = Date 
        DTPicker3.Value = Date 
        
        Me.DTPicker1.Format = dtpCustom 
        Me.DTPicker1.CustomFormat = "yyyy-MM-dd hh:mm:ss" 
        Me.DTPicker1.Value = Now     moldWidth% = Me.Width 
        moldHeight% = Me.Height 
            Dim lngCycVar As Long     Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2     For lngCycVar = 0 To MenuHeader.Count - 1         MenuHeader(lngCycVar).Picture = img1.Picture 
            MenuHeader(lngCycVar).Height = img1.Height 
            MenuHeader(lngCycVar).Width = picNavigationFrame(lngCycVar).Width     Next     Call ResizeInit(Me) 
        Call CornerEdit 
        Call connet End Sub 这一段是初始化窗体,并居中显示
      

  7.   

    Private Sub Form_Resize()     On Error Resume Next 
        Call ResizeForm(Me)     If WindowState <> vbMinimized Then         If Me.Width < 9000 Then             Me.Width = 9000         End If         If Me.Height < 5445 Then      '5445             Me.Height = 5445         End If         imgCorner(1).Left = Me.Width - 105 
            imgCorner(2).Top = Me.Height - 105 
            imgCorner(3).Left = Me.Width - 105 
            imgCorner(3).Top = Me.Height - 105         imgBorder(1).Left = Me.Width - 45 
            imgBorder(2).Top = Me.Height - 45         imgTitleButton(0).Left = Me.Width - 930 
            imgTitleButton(1).Left = Me.Width - 630 
            imgTitleButton(2).Left = Me.Width - 330         lblTitle.Width = Me.Width - 345     End If     If WindowState <> vbMinimized Then         LastState = WindowState 
            Call CornerEdit     End If     Select Case WindowState         Case vbMinimized         AddToTray Me, frmMenu.RightMenu 
            SetTrayTip "水泥微机配料系统" 
            Me.Visible = False         Case vbMaximized         RemoveFromTray         Case vbNormal         RemoveFromTray     End Select 
        If WindowState = vbMinimized Or WindowState = vbMaximized Then Exit Sub     Me.Height = moldHeight% 
        Me.Width = moldWidth%     Exit Sub End Sub 
    这一段主要是窗体改变大小时,窗体的控件大小也跟着改变,设置窗体在不同窗体状态下的状态.