如何关闭打开的数据库(ACCESS)

解决方案 »

  1.   

    Dim conn As New ADODB.Connection
    conn.close
      

  2.   

    Dim conn As New ADODB.Connection
    conn.close
    set conn = Nothing
      

  3.   

    Public Cnn As New ADODB.Connection  '
    Public Rst As New ADODB.Recordset
    rst.close      '先关闭集合
    set rst=Nothing  
    cnn.close      '再关闭连接 
    set conn = Nothing
      

  4.   


    if rs.state<>adstateclose then rs.close
    set rs=nothingif conn.state<>adstateclose then conn.close
    set conn=nothing
      

  5.   

    Dim CN As New ADODB.Connection
    CN.close
    set CN = Nothing
      

  6.   

    可以在类里写一个CloseDatabase的方法来关闭
      

  7.   

    我是在登陆后就把数据库打开了!进入mdi窗口后,我做了个数据备份(access)是通过拷贝来完成的,我用conn.close关闭不了的,有什么好的办法可以解决这个问题!谢谢!
      

  8.   

    if conn.State =1 then '判断是否打开状态
        conn.close                
        set conn=nothing    '释放内存
      end if