Trying to copy an entire table from an Access DB to an Excel file.
The code below is successful in copying the original table to the new table
within the same DB.
However, I would like to take the data from the original table in the
DB and put it into a new spreadsheet at another location on the LAN.
How can I do this?
Moreover, I want this to be a scheduled run that overwrites the same
Spreadsheet file - how can I make SURE it overwrites the same file?
-------
Option Explicit
Dim cnPowell
Set cnPowell = CreateObject("ADODB.Connection")
cnPowell.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"User ID=scrump; Data Source=C:\PB2000.mdb;" & _
"Jet OLEDB:System database=C:\secured.mdw"
cnPowell.open
cnPowell.Execute "select * into tblNew from tblOriginal"
--------
Thanks for the help as always.
Nick