Query Result to a Text File [message #142037] |
Thu, 13 October 2005 05:13 |
abmohan75
Messages: 7 Registered: October 2005
|
Junior Member |
|
|
Hello All!,
I am having Oracle 10i/Windows 2000 Server. I would like to export query result to a text file. If any one give idea that I can implement in my VB project.
I'm waiting for your valuable suggestions.
Regards,
Mohan
|
|
|
|
Re: Query Result to a Text File [message #142921 is a reply to message #142057] |
Tue, 18 October 2005 07:31 |
abmohan75
Messages: 7 Registered: October 2005
|
Junior Member |
|
|
Finally I found the solution. And I would like to share here, that may useful for others too.
Dim fs As New FileSystemObject, txtf
Dim clsvar As New Class3
Dim sql As String
Dim rsc As New ADODB.Recordset
Set txtf = fs.CreateTextFile("c:\test.txt", True)
sql = "select * from test1"
If rsc.State = adStateOpen Then rsc.Close
rsc.Open sql, clsvar.conn
While Not rsc.EOF
txtf.WriteLine (rsc(0).Value & vbTab & rsc(1) & vbTab & rsc(2))
rsc.MoveNext
Wend
txtf.Close
set rsc = Nothing
MsgBox "Over"
Regards,
Mohan
[Updated on: Tue, 18 October 2005 07:32] Report message to a moderator
|
|
|