transferspreadsheet

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
 
G

giorgio rancati

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
 
B

bill

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top