Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export Access Table

Status
Not open for further replies.

komark

Technical User
Sep 12, 2005
134
US
Hi,
I was just wondering if I can export a table from an access dB into excel without opening the access db?
I was wanting to do this VBScript so I can run a Windows Scheduler to automate the whole process.

Thanks in advance
Omar
 
Have a look at the /x command line option of msaccess.exe

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
i think this is what you need:
Code:
db_path = "c:\directory\access_db.mdb"   
Set objConnection = CreateObject("ADODB.Connection") 
objConnection.Open _
   "Provider = Microsoft.Jet.OLEDB.4.0; " & _
   "Data Source = " & db_path  
commandstring = "SELECT * INTO [Excel 8.0;HDR=Yes;" & _
        "Database=c:\where\excel\file\should_go\ &
          excel_name & ".xls].Sheet1 FROM " &  tbl_name   
objConnection.Execute commandstring
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top