View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jamie Collins Jamie Collins is offline
external usenet poster
 
Posts: 593
Default Using "Select-Into" text file from XL (Attn: Jamie Collins, ot

quartz wrote ...

Thanks, I will give this a try...


Quartz,
The examples posted by keepITcool use Excel rather than Oracle as the
data source. A Jet driver/provider must be used for this syntax to
work. If your source database is non-Jet, you will need to be able to
query it using odbc and thereby use Jet's 'pass through' query
functionality.

I don't have Oracle, so here's an example that uses an odbc connection
to a SQL Server database:

SELECT
fname, minit, lname
INTO
[Text;Database=C:\My Folder\;].MyFile#txt
FROM
[ODBC;Driver={SQL
Server};SERVER=MYSERVER;DATABASE=pubs;UID=***;Pwd= ***;].employee
;

keepITcool,
I see you used the fso to delete the existing text file. Because in
the Jet context a file is a table, you may use the DROP TABLE syntax
e.g.

DROP TABLE
[Text;Database=C:\My Folder\;].[MyFile#txt]
;

Jamie.

--