transferspreadsheet

  • Thread starter Thread starter bill
  • Start date Start date
B

bill

How can I export data to Excel in an ADP?

In an mdb, I would create a querydef and export it using
transferspreadsheet, and then delete the querydef.

Can I create a stored procedure or view from the adp, and export it?

Thanks
Bill
 
bill said:
How can I export data to Excel in an ADP?

In an mdb, I would create a querydef and export it using
transferspreadsheet, and then delete the querydef.

Can I create a stored procedure or view from the adp, and export it?

yes
---------------
CurrentProject.Connection.Execute _
"IF OBJECT_ID('View1') IS NOT NULL " & _
" DROP VIEW View1"

CurrentProject.Connection.Execute _
"CREATE VIEW View1 AS " & _
"Select * From MyTable " & _
"Where Id Between 10 AND 20"

DoCmd.OutputTo acOutputServerView, _
"view1", acFormatXLS, CurrentProject.Path & "\Test.xls"
-----------------

Thanks
Bill

Ciao Giorgio
 
Thanks, man!

giorgio rancati said:
yes
---------------
CurrentProject.Connection.Execute _
"IF OBJECT_ID('View1') IS NOT NULL " & _
" DROP VIEW View1"

CurrentProject.Connection.Execute _
"CREATE VIEW View1 AS " & _
"Select * From MyTable " & _
"Where Id Between 10 AND 20"

DoCmd.OutputTo acOutputServerView, _
"view1", acFormatXLS, CurrentProject.Path & "\Test.xls"
-----------------



Ciao Giorgio
 
Back
Top