Re: Can an "Update" Query insert quotation marks around text?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Rodney Dangerfield (RodneyDangerfield_at_discussions.microsoft.com)
Date: 11/19/04


Date: Thu, 18 Nov 2004 17:37:03 -0800

Ok, I see now, Ken

I'm sure you're right.

Well, you've given me the basic solution . . . and I'll probably try to make
a macro or something like that to remove the extra quotes after exporting the
records.

Once again, THANKS for your help! I am grateful.

Bye

Jim (er, Rodney Dangerfield) -- "I don't get no respect!"

"Ken Snell [MVP]" wrote:

> What's happening is that the doubling of the quotes (resulting in triple
> quotes) is because the software is reacting to the presence of your quotes.
> In Microsoft products, when a " character is embedded in a text string, and
> that text string is delimited by " characters within the software, the
> software doubles the " character because that tells the software that the "
> is not the beginning or end of a text string, but a literal " character.
>
> Thus, you see """ at the beginning of the string, which correctly
> intrepreted is this: the first " marks the beginning of the text string,
> and the next two " characters ("") together are meant as a single " (the "
> that you have in your ACCESS value) when the string is printed or displayed.
> Similarly, the three trailing " characters have a similar interpretation:
> the first two ("") are the one " that you had in your text string in ACCESS,
> and the last " character marks the end of the text string.
>
> As I noted, it's unusual to need to delimit a text string with " characters
> within an ACCESS field. You're seeing one result of why it's not typically
> done.
> --
>
> Ken Snell
> <MS ACCESS MVP>
>
>
>
> "Rodney Dangerfield" <RodneyDangerfield@discussions.microsoft.com> wrote in
> message news:CB53483E-2415-4A4B-9BD5-EEB3D1FC1829@microsoft.com...
> > Sorry I missed that, Ken. Ok. Yes, I tried this and you are right . . .
> my
> > records are now updated to include " " marks around the text. That's
> perfect!
> >
> > But now I've got another problem, I think. Here's what's happening . . .
> >
> > (a) I open the table
> > (b) I then drag my cursor over the three rows I want to copy (which now
> all
> > DO have the "quotes" around them)
> > (c) I then "paste" them into any other word processing document (MS-Word,
> > Notepad, or etc)
> > (d) Here's what get's pasted . . .
> >
> > """arizona state"""
> > """california state university"""
> > """michigan college"""
> >
> > THE PROBLEM: No matter which word processing software I use to test the
> > pasting process (MS-Word, Notepad) . . . I'm getting 2 (!) extra sets of
> > quotations around each line. In other words, although INside Access
> (when
> > viewed in table view) the records look like this:
> >
> > "arizona state"
> > "california state university"
> > "michigan college"
> >
> > BUT . . . . as soon as I "copy-and-paste" that information into any other
> > software, some HIDDEN (extra?) sets of quote marks appear. Geeesh. How
> to I
> > avoid this? Any idea? Thanks
> > "Ken Snell [MVP]" wrote:
> >
> > > That was the second part of my reply. I posted an example of an update
> query
> > > that would do this.
> > >
> > > --
> > >
> > > Ken Snell
> > > <MS ACCESS MVP>
> > >
> > > "Rodney Dangerfield" <RodneyDangerfield@discussions.microsoft.com> wrote
> in
> > > message news:02037C55-09A5-48D8-80E3-EB5F246CD546@microsoft.com...
> > > > Hi Ken
> > > > Thanks for the reply.
> > > >
> > > > No, I don't want to ad the quotations during any data export.
> > > >
> > > > Rather, I want the actual quotation marks to be stored IN the record.
> (I
> > > > want to store the text WITH the actual quote marks, i.e. "arizona
> state
> > > > college").
> > > >
> > > > Do you know how to do this?
> > > >
> > > > Jim
> > > >
> > > > "Ken Snell [MVP]" wrote:
> > > >
> > > > > It's a bit unusual to delimit a text value in a text field with "
> > > > > characters. Typically, that is done when you export the value to a
> text
> > > file
> > > > > or other file so that the resulting file will know that the output
> is a
> > > text
> > > > > string. Is that why you want to do this? If yes, you can do this
> during
> > > the
> > > > > export process by exporting a query that uses a calculated field in
> > > place of
> > > > > the original field:
> > > > > OutField: Chr(34) & [FieldName] & Chr(34)
> > > > >
> > > > > To do what you ask, yes, an update query can do this:
> > > > >
> > > > > UPDATE TableName
> > > > > SET FieldName = Chr(34) & [FieldName] & Chr(34);
> > > > > --
> > > > >
> > > > > Ken Snell
> > > > > <MS ACCESS MVP>
> > > > >
> > > > > "Rodney Dangerfield" <RodneyDangerfield@discussions.microsoft.com>
> wrote
> > > in
> > > > > message news:829F9960-5C09-4C01-95AF-8D1937D80E8A@microsoft.com...
> > > > > > Hi. My table contains a single text field. That's all! For
> > > instance,
> > > > > one
> > > > > > of the records might be: california state university Another
> > > record
> > > > > > might be: arizon astate
> > > > > >
> > > > > > NEEDED: I need to ad QUOTATION MARKS characters around each
> record,
> > > so
> > > > > they
> > > > > > now will have this format: "california state university" or
> > > "arizona
> > > > > > state"
> > > > > >
> > > > > > Can someone tell me how to create an UPDATE QUERY to do this?
> > > > > >
> > > > > > Thanks
> > > > > >
> > > > > > Rodney Dangerfield
> > > > > >
> > > > > > (I don't get no respect. No respect at all! Hey, when I was born
> I
> > > was
> > > > > > ugly. Real ugly. How ugly was I? When I was born, my mother
> slapped
> > > the
> > > > > > doctor! I'll tell you, I don't get no respect.)
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
>
>
>



Relevant Pages

  • Re: Beginners Program
    ... I'd put single quotes aroung the, ... If you are putting "s in a string then it is usually best to use a different ... input file things could go wrong. ... and that the final line of input does end with a newline character. ...
    (comp.lang.perl.misc)
  • Re: Can an "Update" Query insert quotation marks around text?
    ... quotes) is because the software is reacting to the presence of your quotes. ... that text string is delimited by " characters within the software, ... software doubles the " character because that tells the software that the " ... and the last " character marks the end of the text string. ...
    (microsoft.public.access.queries)
  • Re: Delimiting problems
    ... > So how can I delimit the " character? ... Now when I have a piece of string such as ... If you want to compare against several values, ...
    (comp.lang.c)
  • Re: Re: Vista search including double quote
    ... There is only one occurance of the word Protection in the ... There is no need or reason to enclose one word within quotes in a content ... string that includes a double quote. ... Maybe there's an escape character I can prefix ...
    (microsoft.public.windows.vista.general)
  • Re: ADO Recordset FIND problem
    ... That is the only character that can be confused with a string ... Keep in mind, if you use a double quote as a string delimiter, ... if you wish to use double quotes to delimit ...
    (microsoft.public.scripting.vbscript)