By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,343 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

the jungle of text files - CreateTextFile in unicode

P: n/a
Hi Folks

I am wondering if any of you has any experience with unicode files created
from Access.

I am using an access database to write HTML files. Now, for some of these
files, I use Japanese characters, meaning that I have to create a text file
in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True, UniCode(I))
Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as unicode
(yes or no). However, when I then open the resulting HTML file, it shows
nothing. If you go view source in Internet Explorer then you just see about
two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be opened
and read.

TIA

- Nicolaas
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
WindAndWaves wrote:
Hi Folks

I am wondering if any of you has any experience with unicode files created
from Access.

I am using an access database to write HTML files. Now, for some of these
files, I use Japanese characters, meaning that I have to create a text file
in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True, UniCode(I))
Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as unicode
(yes or no). However, when I then open the resulting HTML file, it shows
nothing. If you go view source in Internet Explorer then you just see about
two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be opened
and read.

TIA

- Nicolaas


Since the act of opening/saving in another editor permits the file to be
displayed that indicates there is a difference between what you write
out originally and what is saved. Maybe you don't have an EOF or some
hidden character. What you need is an editor where you can compare the
differences between the two files. Either that, or write a routine to
compare the diffrences. I'll bet you are missing a control character or
something similar.
Nov 13 '05 #2

P: n/a

"Salad" <oi*@vinegar.com> wrote in message
news:Kr*****************@newsread3.news.pas.earthl ink.net...
WindAndWaves wrote:
Hi Folks

I am wondering if any of you has any experience with unicode files created from Access.

I am using an access database to write HTML files. Now, for some of these files, I use Japanese characters, meaning that I have to create a text file in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True, UniCode(I)) Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as unicode (yes or no). However, when I then open the resulting HTML file, it shows nothing. If you go view source in Internet Explorer then you just see about two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be opened and read.

TIA

- Nicolaas


Since the act of opening/saving in another editor permits the file to be
displayed that indicates there is a difference between what you write
out originally and what is saved. Maybe you don't have an EOF or some
hidden character. What you need is an editor where you can compare the
differences between the two files. Either that, or write a routine to
compare the diffrences. I'll bet you are missing a control character or
something similar.


Hi Salad

That is pretty much what I suspected. How do I compare the two though. Do
you know of any programs that literally read the entire file, including the
hidden elements?
Nov 13 '05 #3

P: n/a
WindAndWaves wrote:
"Salad" <oi*@vinegar.com> wrote in message
news:Kr*****************@newsread3.news.pas.earthl ink.net...
WindAndWaves wrote:

Hi Folks

I am wondering if any of you has any experience with unicode files
created
from Access.

I am using an access database to write HTML files. Now, for some of
these
files, I use Japanese characters, meaning that I have to create a text
file
in unicode.

Here is the code that I use:

Set RstSQ = Dbs.OpenRecordset(SQLstatement)
Set Fs = CreateObject("Scripting.FileSystemObject")
Set A = Fs.CreateTextFile(Path & FileNameCreator(I), True,
UniCode(I))
Do While Not RstSQ.EOF
Fldn = RstSQ.Fields("D")
html = RstHTML.Fields(Fldn) & ""
A.Write html
RstSQ.MoveNext
Loop
A.Close
RstSQ.Close
Unicode is a function that determines if the file should be saved as
unicode
(yes or no). However, when I then open the resulting HTML file, it
shows
nothing. If you go view source in Internet Explorer then you just see
about
two strange characters, that is it.

Through trial and error I worked out that if I open the file in another
advanced text-editor and resave the thing, the file can actually be
opened
and read.

TIA

- Nicolaas


Since the act of opening/saving in another editor permits the file to be
displayed that indicates there is a difference between what you write
out originally and what is saved. Maybe you don't have an EOF or some
hidden character. What you need is an editor where you can compare the
differences between the two files. Either that, or write a routine to
compare the diffrences. I'll bet you are missing a control character or
something similar.

Hi Salad

That is pretty much what I suspected. How do I compare the two though. Do
you know of any programs that literally read the entire file, including the
hidden elements?


I have an old DOS program called NE (norton editor). You can put 2
files into 2 separate windows and run a compare. It shows the
difference between the two. I know that in one of those SourceSafe type
programs you could do filecompares. You could want to check out
http://www.tucows.com for editors. Also, there might be hex editors
that will show differences.

Hmmm...goto Start/Run and get to DOS by entering Command (Run) and
enter COMP/?
at the DOS prompt

There are some options with COMP that may help you out.
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.