Results 1 to 2 of 2
  1. #1
    sockswithsandals is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    7

    Excel to Access ADODB.connection -> "not a valid password" error problem

    Hi,



    I have huge problem with password protected Access database. I have code that I use to connect to this Access file (.accdb) from Excel and everything works smoothly. But now as I add password to the Access file I just am not able to connect to it anymore. I get every time this "not a valid password" error. And I'm sure that password is correct. I'm using Excel 2010 and Access 2010. Password is passw .

    I've been trying following with different quotation marks positions etc but with no luck:
    Code:
    Set Cnn = New ADODB.Connection
    
    Cnn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Practise.accdb;Jet OLEDB:Database Password=passw"
    Cnn.Open
    -> not a valid password in cnn.open line

    Code:
    Const sDB = "Practise.accdb"
    
    Set Cnn = New ADODB.Connection
    MyConn = ThisWorkbook.Path & Application.PathSeparator & sDB
    
    With Cnn
        .Provider = "Microsoft.Ace.OLEDB.12.0; Persist Security Info =false;"
        .Properties("jet oledb:database password") = "passw"
        .Open MyConn
    End With
    -> not a valid password in .open MyConn line

    Code:
    Const sDB = "Practise.accdb"
    
    Set Cnn = New ADODB.Connection
    MyConn = ThisWorkbook.Path & Application.PathSeparator & sDB
    
    With Cnn
        .Provider = "Microsoft.Ace.OLEDB.12.0; Persist Security Info =false;"
        .Open MyConn, Password:="passw"
    End With
    -> this leads to "Cannot start your application. The workgroup information file is missing or opened exclusively by another user." Workgroup information file? It is not opened by another user.

    I'm getting really desperate here. Any help please?
    Attached Files Attached Files

  2. #2
    sockswithsandals is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    7
    Okay, found this piece of code from internet as someone had similar case as I have. If I have database test.accdb (password: test) then I get error "not a valid password" but when I tried this exactly same code and setup with a computer that has Windows XP (the other one has Windows 7) and it worked smoothly. Does anyone know anything of this? Bug or what's going on?

    Code:
    Public Sub TestSub()
    
        Dim strConnection As String
        Dim cnn As ADODB.Connection
    
        strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
            "Data Source=C:\test.accdb;"
    
        Set cnn = New ADODB.Connection
        cnn.ConnectionString = strConnection
        cnn.Properties("Jet OLEDB:Database Password") = "test"
        cnn.Open
    
        Debug.Print cnn.State = adStateOpen
    
        cnn.Close
    
    End Sub

    edit. The XP computer is my private one and Windows 7 work laptop. But there shouldn't be any issues with user permissions/rights as the code works if I don't have Access file password protected...? Also with the XP computer got the "Cannot start your application..." error notification.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 03-22-2012, 08:31 PM
  2. 2010 Runtime ADODB Connection Failure
    By SteveDurham in forum Access
    Replies: 2
    Last Post: 10-04-2011, 03:31 PM
  3. Access 2010 (accdb) "not a valid password"
    By harrypotter in forum Access
    Replies: 5
    Last Post: 08-02-2011, 10:37 AM
  4. Runtime 2010 ADODB Connection failure
    By SteveDurham in forum Import/Export Data
    Replies: 5
    Last Post: 07-18-2011, 12:53 PM
  5. Test for valid ODBC connection
    By jgelpi16 in forum Programming
    Replies: 1
    Last Post: 06-10-2011, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums