Exporting SQL View to Text

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
 
J

John Nurick

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
 
G

Guest

Hi John
Have tried using DoCmd.TransferText but it does not seems to work with ADP.
Error message "Can't find the object 'MyView'.
 
J

John Nurick

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.
 

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