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