Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
cg cg is offline
external usenet poster
 
Posts: 11
Default SELECT * INTO[Text;DATABASE...

All,

I am in EXCEL trying to use ADO to connect to an Oracle table and save the
table as a text file. Here is the code I am attempting to use:

Public Sub OracleExtracttoTXT()

Dim cn As ADODB.Connection
Dim sqlString As String
Dim strConn As String

Set cn = New ADODB.Connection
strConn = "Driver={Oracle in instantclient10_1};"
strConn = strConn & "DBQ=PROD;Uid=JDoe;Pwd=Doe5;"

cn.Open strConn

sqlString = "SELECT * INTO [Text;DATABASE=C:\Documents and
Settings\JDoe\Desktop].[Test.txt] FROM GL_PERIODS"

cn.Execute sqlString
cn.Close
Set cn = Nothing
End Sub

Excel shuts down on me everytime I run this. Any ideas what I am doing wrong?

Thanks!!!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to handle database insert, update and select in excel? anders123 Excel Worksheet Functions 0 May 23rd 08 03:20 PM
select multiple records in database given conditions MayFestivalRon Excel Worksheet Functions 1 May 9th 08 09:49 PM
how do I select unique dates from a database in Excel? pomalley Excel Worksheet Functions 3 March 9th 05 03:02 PM
I can I select cells in a template and link it to a database? group3 Excel Discussion (Misc queries) 1 December 31st 04 03:05 PM
select database rexmann Excel Discussion (Misc queries) 2 December 7th 04 09:55 AM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"