🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.databases.ms-access
2 messages
2 total messages Started by asd987 Sun, 23 May 2004 19:10
replacing text during output
#199
Author: asd987
Date: Sun, 23 May 2004 19:10
8 lines
1851 bytes
Hi,

Ihave to print a field (type memo) to a file. I know how to do that ;-), but
there's one complication: all single quotes (') in the record must be
replaced by <backslash> + <single quote> (\') before (or during) printing to
the file. How do I do this?

Thanks.
Re: replacing text during output
#200
Author: Graham Mandeno
Date: Sun, 23 May 2004 21:37
27 lines
2214 bytes
You can use the Replace function to change all the quotes as required:
    Replace( [FieldName], "'", "\'" )

You didn't say *how* you were writing to the file, but if it's using VBA
file Print# then you can use store the Replace result in a temporary string
variable and write that to the file.  If you're using TransferText, then use
Replace in your source query.
-- 
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"asd987" <asd987@home.nl> wrote in message
news:c8qt02$gj6$1@news5.tilbu1.nb.home.nl...
> Hi,
>
> Ihave to print a field (type memo) to a file. I know how to do that ;-),
but
> there's one complication: all single quotes (') in the record must be
> replaced by <backslash> + <single quote> (\') before (or during) printing
to
> the file. How do I do this?
>
> Thanks.
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads