A
Al Blake
I need to connect to a base table that has the extension '.D' in stead of
the standard .DBF
This is legacy app so I cant change the file extensions or it will break
Unfortunately the ODBC drivers for dbase will *ONLY* open a table if it has
a .DBF extension.
I thought I had found an answer with some old info on the MSDN site that
stated DAO would
open fielnames with other extensions if you separated the exsention with a #
sign:
"The name of the table -- the .DBF filename without the extension, or the
complete filename with the extension but substituting a pound sign (#) for
the dot (.) that precedes the filename extension"
This was in the "Accessing External Data with Access 2.0" at
http://msdn.microsoft.com/archive/d...ccessingexternaldatawithmicrosoftaccess20.asp
However I have spent hours trying to code an equivalent and cant get it to
work. Has this functionality been dropped or does anyone know another way to
reproduce it.
Here's my code that fails:
Sub linktable()
Dim myCurrentdb As Database
Dim myTabledef As Tabledef
Set myCurrentdb = Currentdb()
Set myTabledef = Currentdb.CreateTableDef("test")
myTabledef.Connect = "dbase III;DATABASE=C:\temp"
myTabledef.SourceTableName = "LBORROW#D"
myCurrentdb.TableDefs.Append myTabledef <== fails here indicating it
cant find the table.
End Sub
Al Blake, Canberra, Australia
the standard .DBF
This is legacy app so I cant change the file extensions or it will break
Unfortunately the ODBC drivers for dbase will *ONLY* open a table if it has
a .DBF extension.
I thought I had found an answer with some old info on the MSDN site that
stated DAO would
open fielnames with other extensions if you separated the exsention with a #
sign:
"The name of the table -- the .DBF filename without the extension, or the
complete filename with the extension but substituting a pound sign (#) for
the dot (.) that precedes the filename extension"
This was in the "Accessing External Data with Access 2.0" at
http://msdn.microsoft.com/archive/d...ccessingexternaldatawithmicrosoftaccess20.asp
However I have spent hours trying to code an equivalent and cant get it to
work. Has this functionality been dropped or does anyone know another way to
reproduce it.
Here's my code that fails:
Sub linktable()
Dim myCurrentdb As Database
Dim myTabledef As Tabledef
Set myCurrentdb = Currentdb()
Set myTabledef = Currentdb.CreateTableDef("test")
myTabledef.Connect = "dbase III;DATABASE=C:\temp"
myTabledef.SourceTableName = "LBORROW#D"
myCurrentdb.TableDefs.Append myTabledef <== fails here indicating it
cant find the table.
End Sub
Al Blake, Canberra, Australia