CleanString() method

C

chieko

Hi,
I'm trying to clean up a text file that I BCP'ed out of SQL Server
using the CleanString method. It works on small files of less than .5 mb,
but truncates larger files of 1mg or greater.
Does any one know why this is occurring? Is there a way to do this in visual
basic?
 
K

Klaus Linke

chieko said:
Hi,
I'm trying to clean up a text file that I BCP'ed out of SQL Server
using the CleanString method. It works on small files of less than .5 mb,
but truncates larger files of 1mg or greater.
Does any one know why this is occurring? Is there a way to do this in
visual basic?


Hi Chieko,

I either get an error "Buffer too small for returned string" for strings >
32 kB, or a truncated string.

So you may have to do the replacements that are listed in the help for
CleanString yourself, one by one.
Many of them don't seem to make any sense, but then I don't know a thing
about databases.

Regards,
Klaus
 
K

Klaus Linke

Many of them don't seem to make any sense, but then I don't know a thing
about databases.

To clarify: CleanText seems to be an old function designed to remove some
characters that some old databases had problems with. It probably was
restricted to 64kB strings, which was further reduced to 32 kB when Office
changed to Unicode.

But with Unicode, there doesn't seem any reason to strip/replace certain
characters, unless I miss something.

BTW, some other old outdated string functions are limited to 32kB, too, like
TypeText.

Klaus
 
C

chieko

Okay, thanks for the help.
Chieko

Klaus Linke said:
To clarify: CleanText seems to be an old function designed to remove some
characters that some old databases had problems with. It probably was
restricted to 64kB strings, which was further reduced to 32 kB when Office
changed to Unicode.

But with Unicode, there doesn't seem any reason to strip/replace certain
characters, unless I miss something.

BTW, some other old outdated string functions are limited to 32kB, too, like
TypeText.

Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top