总是提示“工作组信息文件丢失,或者文件被其他系统以独占方式打开?”
连接串:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data2000.mdb;Mode=ReadWrite|Share Deny None;Persist Security Info=False;Jet OLEDB:Database Password=aaaa环境: 
winxp或者win2003
office2003或者office97
vb6不设置密码连接可以, 设置密码就不行。

解决方案 »

  1.   

    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data2000.mdb;Persist Security Info=False;Jet OLEDB:Database Password=aaaa
      

  2.   

    把中间的Mode=ReadWrite|Share Deny None这段去掉再试
      

  3.   

    '************************************************
    '**
    '** 函数名称:  ConnectDBAccess
    '** 版    本:  V1.0.0
    '** 函数功能:  打开ACCESS数据库文件'** 参数说明:
    '**             strFile    文件名称
    '**             strPass    数据库密码
    '** 函数返回:
    '**             ADODB.Connection 类型
    '**             如果打开有错则给出提示
    '** 创 建 人:  刘东
    '** 日    期:  2005-02-28
    '** 修 改 人:
    '** 日    期:
    '** 参考实例:
    '** 补充说明:
    '**
    '************************************************Private Function ConnectDbAccess(strFile As String, StrPass As String)    On Error GoTo ConnectErr:
        
        dim gMsg as string 
        dim gStyle as string
        dim gTitle as string 
        dim gResponse as string     If CheckFileExist(strFile) = True Then    '检查文件是否存在        Set mDbAccess = New ADODB.Connection
            mDbAccess.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
                             "Dbq=" & strFile & ";" & _
                             "Uid=admin;" & _
                             "Pwd=" & StrPass & ";"
            Exit Function    End IfConnectErr:    gMsg = "数据库连接未成功!" & Chr(13) & "" & Chr(13) & "  程 序 终 止 !"
        gStyle = vbOKOnly + vbInformation + vbDefaultButton1
        gTitle = "数据库错误!"
        gResponse = MsgBox(gMsg, gStyle, gTitle)
        
        Set mDbAccess = Nothing
        
    EndEnd Function
      

  4.   

    上面的一个函数刚才漏了'//检查文件是否存在,存在返回 TRUE,否则返回FALSE
    Public Function CheckFileExist(strFile As String) As BooleanIf Dir(strFile, vbDirectory) <> "" Then    CheckFileExist = True
    Else    CheckFileExist = False
        
    End IfEnd Function
      

  5.   

    如果用添加adodc控件,设置属性的方法设置连接串,数据源,总是不行,最后也没有搞定,只能连接没有密码的access数据库。但是不是在界面设计时加控件,直接添加代码就可以连接有密码的了,大家说说怎么回事??
      

  6.   

    這個問題剛剛前幾天碰到也正好解決
    Dim Cn As New ADODB.Connection
    Cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\TEST.mdb;Jet OLEDB:Database Password=123456;"
    Cn.Open
      

  7.   

    目的是实现了,但是问题还是没解决!!adodc就是不能连接设置密码的数据库??唉,现在学学程序,做点东西怎么这么难嘀!!!!!老了啊!!