你的那些ADO连接都close了吗?

解决方案 »

  1.   

    调用CopyMemory这样的API吗?
    重新打开工程后,是不是就好了呢?也许是VB6的BUG也说不定。
      

  2.   

    to:bdgyz(中关村)
    联接都关闭了,是关了以后才Set XXX =Nothing的。
    to:AdamBear(学习再学习)
    没有调用API函数,重新打开后就好了,但用不了几个小时又慢下来了。
      

  3.   

    Private Sub Edit_Click() '考核项目修改过程
    Dim i As Long
    Dim temp As String
    Dim comm As New ADODB.Command
    Dim commStr As String
    Dim cat As New ADOX.Catalog
    Dim tblTable As New ADOX.Table
    Dim colColumn As New ADOX.ColumnIf dang <> "" Then    temp = Trim(InputBox("请输入新的考核项目名称:"))
        If temp <> "" Then
            For i = 1 To 20 '判断是否有重复考核项目名称
                If temp = flxg1.TextMatrix(i, 1) Or temp = dang Then
                    MsgBox "请输入不重复的考核项目名称。", vbOKOnly + vbInformation
                    Exit Sub
                End If
            Next
            '将考核项目从考核项目表中更新
            commStr = "Update 考核项目表 Set 考核项目='" & temp & "' Where 考核项目='" & dang & "' And 人员类型='" & Combo2.Text & "'"
            Set comm.ActiveConnection = Conn
            comm.CommandText = commStr
            comm.Execute
            If Combo2.Text <> "厂部考评" Then
                '将考核项目字段从基本数据表中更新
                Set cat.ActiveConnection = Conn
                Set tblTable = cat.Tables("基本数据表")
                Set colColumn = tblTable.Columns(Combo2.Text & dang)
                colColumn.Name = Combo2.Text & temp
                Set cat = Nothing
                Set colColumn = Nothing
                Set tblTable = Nothing
            Else
                '将考核项目字段从厂部考评表中更新
                Set cat.ActiveConnection = Conn
                Set tblTable = cat.Tables("厂部考评表")
                Set colColumn = tblTable.Columns(Combo2.Text & dang)
                colColumn.Name = Combo2.Text & temp
                Set cat = Nothing
                Set colColumn = Nothing
                Set tblTable = Nothing
            End If
            '刷新列表
            Call Combo2_Click
            dang = temp
        End If
    End If
    End Sub
    +++++++++++++++++++++++++++++++++
    部分代码在这里了,请各位高手指点!
    +++++++++++++++++++++++++++++++++
      

  4.   

    还是少了一个
    set comm =nothing
      

  5.   

    我用VB6作程序,每天要重启>3次,
    在win98 下,很不爽的。
      

  6.   

    VB就是这样的了,有时就算你Set = Nothing了,他也不释放内存,把实例全都留在内存里,直到你整个程序退出了,才释放
      

  7.   

    注意撤消对象的顺序
    Set colColumn = Nothing
    Set tblTable = Nothing
    Set cat = Nothing