Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

ADODB.Stream object WriteLine Method supports vbTab

$
0
0
Hello All,

I am using ADODB.Stream object loading data to excel file(.XLS) to convert Unicode format text.
Below code i am using for Unicode conversion.

Function OutputOneFileNew(flCnt, RS, fs)

Dim strFileName, recCnt, OutFile

Dim objStream
Set objStream = CreateObject("ADODB.Stream")
objStream.CharSet = "utf-8"
objStream.Open
'objStream.WriteText "The data I want in utf-8"
'objStream.SaveToFile "C:\Users\admin\Desktop\test.txt", 2

recCnt = 0
strFileName = Application("OutputPath") & Session("LoginID") & "-" & flCnt & ".xls "

' Set OutFile = fs.CreateTextFile(strFileName,True)
' Set OutFile = fs.LoadFromFile(strFileName)



For i = 0 To RS.Fields.Count - 1
RowData = RowData & RS(i).Name & vbTab
Next
RowData = RowData & vbCRLF
objStream.WriteText(RowData)
'OutFile.WriteLine(RowData)
'On Error Resume Next


Do While ((Not RS.EOF) And (recCnt < 65000))
RowData=""


For i = 0 To RS.Fields.Count - 1

'If Err.Number <> 0 Then
' response.Write(RowData)
RowData = RowData & RS(i) & vbTab
' RowData = replace(RowData,vbCRLF," ")
'End If
Next
RowData = RowData & vbCRLF
objStream.WriteText(RowData)
' OutFile.WriteLine(RowData)

RS.MoveNext
recCnt = recCnt + 1
Loop
objStream.SaveToFile strFileName, 2
'OutFile.Close
objStream.Close
ENd Function.

In above i am code Can ADO.stream WriteLine method supports VBtab?
I need to load in excel data output like individual header column with individual row data line by line.

Please help me on this.
Attached Images
 

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>