T
Tony Wainwright
Hi Guys
I am trying to get an Access XP database to read from an external data
source (Excel - I have tried TransferSpreadsheet but it doesn't work how I
want it). I am now experimenting with ODBC. From the help files I can make
a connection to the Excel file I want, but it keeps asking for the path to
the data file. I am already passing this using Ken Getz and Paul Litwin's
OpenDialog routines - published I think on Lebans's website - and would like
to use this as the OpenDialog. To prove the code works I am using the
following sample (strPath will eventually contain the OpenDialog routine).
strPath = "D:\Tony's\IT Solutions\Clients\Gojo\Spreadsheets\Import Soap Data
SEP 04 YTD.xls"
strConnect = "ODBC;DATABASE=" & strPath & ";DSN=Excel Files"
Set conSoap = wrkODBC.OpenConnection("Soap Data", dbDriverComplete, False,
strConnect)
Once VBA executes the 'Set conSoap = ....' line I get a Select Workbook
Dialog, then the code executes normally. How do I get this code to utilise
the OpenDialog routine rather than the Select Workbook dialog?
Cheers
Tony
I am trying to get an Access XP database to read from an external data
source (Excel - I have tried TransferSpreadsheet but it doesn't work how I
want it). I am now experimenting with ODBC. From the help files I can make
a connection to the Excel file I want, but it keeps asking for the path to
the data file. I am already passing this using Ken Getz and Paul Litwin's
OpenDialog routines - published I think on Lebans's website - and would like
to use this as the OpenDialog. To prove the code works I am using the
following sample (strPath will eventually contain the OpenDialog routine).
strPath = "D:\Tony's\IT Solutions\Clients\Gojo\Spreadsheets\Import Soap Data
SEP 04 YTD.xls"
strConnect = "ODBC;DATABASE=" & strPath & ";DSN=Excel Files"
Set conSoap = wrkODBC.OpenConnection("Soap Data", dbDriverComplete, False,
strConnect)
Once VBA executes the 'Set conSoap = ....' line I get a Select Workbook
Dialog, then the code executes normally. How do I get this code to utilise
the OpenDialog routine rather than the Select Workbook dialog?
Cheers
Tony