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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert data from a table to Excel 1

Status
Not open for further replies.

itmasterw

Programmer
Apr 13, 2003
147
US
Hi,
I am trying to put the data from a table into an Excel spreadsheet. People I work with said that they have done something like the following, but are not quite sure of the systex. THey said this should create the spreadsheet and insert the data. However, no matteres how I do this it comes back with either "incomplete query cluase" Or " Syntex error. I think I can do this with loops, but if I can get this statement to work it would be better.

Here is the code I have:

SQLStr = "SELECT * INTO '[Excel 8.0; Database = G:\APPO\MerlsS2.XLS].[Sheet1]' FROM tblFinalOut"
CN.Execute SQLStr

Any ideas would be greatly appreacted.
Thank You


 
Try this:

Code:
SQLStr = ("SELECT * INTO [Excel 8.0;" & "Database=G:\APPO\MerlsS2.XLS].[Sheet1]" FROM tblFinalOut")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top