Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    23

    Unanswered: Error in concatenation

    I cannot concatenate properly the line
    Set BackDB = OpenDatabase(DBName,pwd=" & StrPassword)
    which is wrong and gives me errors.Can you help ?

    Public Function ImportAllTables(DBName, strPassword As String)
    strPassword = " pin"
    Dim FrontDB As DAO.Database, BackDB As DAO.Database, Tbl As TableDef
    Set FrontDB = CurrentDb
    Set BackDB = OpenDatabase(DBName,pwd=" & StrPassword)
    For Each Tbl In BackDB.TableDefs
    If Tbl.Attributes = 0 Then
    DoCmd.TransferDatabase acImport, "Microsoft Access", BackDB.Name, acTable, Tbl.Name, Tbl.Name
    End If
    Next
    BackDB.Close
    FrontDB.Close
    End Function

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Do you actually want to import these tables or merely Link to them as in Linking to Backend DB tables?
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    ahhhh...

    Set BackDB = OpenDatabase(DBName,"pwd=" & StrPassword)

    and is the password suppose to have a space before the word pin? (not that you'ld let us know what the password is )

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •