June 14, 2007 at 7:54 am
Hi,
I am writing a ActiveX script to extract data from a LotusNotes database and realised some of the fields contain chinese characters because of which when i am writing data string to a flat file it gives an error " invalid Procedure call or augument".
I have to extract data to a flat file.
Any help will be highly appreciated.
Thanks
SUmit
June 15, 2007 at 3:49 am
You could try using the FileSystemObject to open a text file for Unicode writing using the Tristate switch in the OpenTextFile method.
Function Main
Dim fso
Dim fol
Dim f, sFilename
Dim ts
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateDefault = -2, TristateTrue_Unicode = -1, TristateFalse_ASCII = 0
sFilename = "C:\Test.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
' Create File and then deallocate f as file needs opening for unicode writing
Set f = fso.CreateTextFile(sFilename, True)
Set f= nothing
Set ts = fso.OpenTextFile(sFilename, ForWriting, TristateTrue_Unicode)
'Insert looping for all data lines to be written ---- Fetch > Write
'End Loop
ts.Close
Set ts = Nothing
Set fso = Nothing
End Function
June 15, 2007 at 5:21 am
cool..i ll try this now..thanks alot..
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy