Exporting SQL View to Text

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I used
DoCmd.OutputTo acOutputServerView, "vewMyView", cFormatTXT, "C:\MyText.TXT"
to export a SQL 2000 view in my ADP.
However I get a line of dashes "-------" seperating each row.

Can I get an output without this extra lines of dashes?

Thanks
 
Use DoCmd.TransferText instead.

Hi

I used
DoCmd.OutputTo acOutputServerView, "vewMyView", cFormatTXT, "C:\MyText.TXT"
to export a SQL 2000 view in my ADP.
However I get a line of dashes "-------" seperating each row.

Can I get an output without this extra lines of dashes?

Thanks
 
Hi John
Have tried using DoCmd.TransferText but it does not seems to work with ADP.
Error message "Can't find the object 'MyView'.
 
TransferText is available in an ADP with some limitations (see Help and
e.g. http://msdn2.microsoft.com/en-us/library/aa164088(office.10).aspx
).

I don't have SQL Server running here so can't try this for myself. What
happens if you create an Access query
SELECT * FROM MyView
ORDER BY Whatever;
and pass the name of this query to TransferText rather than "MyView"?

Or you can do it the old-fashioned way: open a recordset on your view
and iterate through it writing the text file one line at a time.
 
Back
Top