Results 1 to 3 of 3
  1. #1
    quicova is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    53

    relink BackEnd file using VBA with password protected file

    Hello everyone.

    I have a code to relink a 2 backend files at start up.
    the problem is one of the files is password encripted.

    anyone can help me fix the code to input the password?
    here is the code

    Code:
    Dim dbsTemp As Database
       Dim strMenu As String
       Dim strInput As String
    
    
       ' Open a Microsoft Jet database to which you will link
       ' a table.
       Set dbsTemp = CurrentDb
    
    
       ' Call the ConnectOutput procedure. The third argument
       ' will be used as the Connect string, and the fourth
       ' argument will be used as the SourceTableName.
             ConnectOutput dbsTemp, _
                "Usernames", _
                ";DATABASE=C:\Users\quico\Desktop\Weight_estimate_software_Usernames.accdb", _
                "Usernames"
             ConnectOutput dbsTemp, _
                "Composite_Parts", _
                ";DATABASE=C:\Users\quico\Desktop\Weight_Estimate_Start_Template.accdb", _
                "Composite_Parts"
    End Function
    
    
    Sub ConnectOutput(dbsTemp As Database, _
       strTable As String, strConnect As String, _
       strSourceTable As String)
    
    
       Dim tdfLinked As TableDef
    
    
       ' Create a new TableDef, set its Connect and
       ' SourceTableName properties based on the passed
       ' arguments, and append it to the TableDefs collection.
       Set tdfLinked = dbsTemp.CreateTableDef(strTable)
    
    
       tdfLinked.Connect = strConnect
       tdfLinked.SourceTableName = strSourceTable
    
    
       dbsTemp.TableDefs.Append tdfLinked
    
    
    End Sub
    this part is calling the password protected database

    Code:
             ConnectOutput dbsTemp, _
                "Usernames", _
                ";DATABASE=C:\Users\quico\Desktop\Weight_estimate_software_Usernames.accdb", _
                "Usernames"
    any ideas?
    Thanks so much

  2. #2
    quicova is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    53
    or even Better,

    if it possible to link to a backend file that has links? that would solve alot of problems

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,028
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. button to link to specific backend file
    By quicova in forum Import/Export Data
    Replies: 5
    Last Post: 11-04-2013, 01:39 PM
  2. Replies: 5
    Last Post: 11-04-2013, 11:39 AM
  3. Hiding backend file
    By ChrisAnthony in forum Security
    Replies: 1
    Last Post: 04-30-2012, 04:13 PM
  4. Replies: 4
    Last Post: 09-14-2011, 12:33 AM
  5. relink to realative locatio to txt file using connect
    By tobynegus in forum Programming
    Replies: 0
    Last Post: 08-21-2008, 04:08 AM

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 - Senior Forums