I am trying to import a table from an access db file. The user will pick the file through the GetOpenFilename application, which seems to be working. I have recorded a macro to open an ODBC connection to an Access db, which also works. The macro fails when I try and use the filename path. Any ideas on how to fix the table import macro or another way to accomplish the import?

Many thanks!

Dim Filename As String
Dim FName As String

Function StripExt(Filename As String) As String
    StripExt = Left$(Filename, (Len(Filename) - 4))
End Function

Private Sub CommandButton3_Click()

Filename = Application.GetOpenFilename() 'Gets file path in diretory menu

FName = StripExt(Filename) 'Removes extension

'The following is a macro recorded as such:_ 
Data\import external data\import data\new source\ODBC DSN\MS Access.....
    With ActiveSheet.QueryTables.Add(Connection:=Array_
(Array("ODBC;DSN=MS Access Database;_
DBQ=P:\Projects\Black Diamond 2007\2007NETBDEMICHELINA.mdb;_
DefaultDir=P:\Projects\Black Diamond 2007;Dri"),_
 Array("verId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;")),_
 Destination:=Range("A30"))
        .CommandText = Array_
("SELECT * FROM `P:\Projects\Black Diamond 2007\2007NETBDEMICHELINA`.`Lease`") '
        .Name = "table"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .PreserveColumnInfo = True
        .SourceConnectionFile = _
"C:\Documents and Settings\Tyler Whitham\My Documents\My Data Sources\.odc"
        .Refresh BackgroundQuery:=False
    End With
End Sub