INSERT: Text field with single- and double-quotes
From: RSGinCA (rsginca_at_aol.com.NO.Spam)
Date: 02/27/04
- Next message: Andrew Smith: "Re: Join a concatenated field"
- Previous message: John Vinson: "Re: Enter parameter once for multiple queries in a Macro"
- Next in thread: John Vinson: "Re: INSERT: Text field with single- and double-quotes"
- Reply: John Vinson: "Re: INSERT: Text field with single- and double-quotes"
- Messages sorted by: [ date ] [ thread ]
Date: 27 Feb 2004 22:49:18 GMT
I've got a program that needs to add records to a table.
One of the fields on the record is a text field, and the data that is going to
be input will sometimes have single- and/or double-quotes. This screws up the
INSERT command.
I'm not dealing with the text directly, but rather with variables which contain
the text, however when the program executes, a command like the following might
be generated:
dbs.Execute "INSERT INTO tblBusiness (BusinessID, BusinessName, Comment) VALUES
('10', 'Fred's Diner', 'Fred's mother said, "Fred's a fine cook... a fine
cook!"');"
Note: this is an oversimplified example, to illustrate the problem. My
situation actually contains a much longer text field which can frequently
contain combinations of both single and double quotes.
Those combinations of quotes doesn't work.
Is there some way to get the INSERT command to work with unpredictable
combinations of single and double quotes in the VALUES clause? Or, does
somebody have an alternative way to suggest for my program to add these
records?
Rick
- Next message: Andrew Smith: "Re: Join a concatenated field"
- Previous message: John Vinson: "Re: Enter parameter once for multiple queries in a Macro"
- Next in thread: John Vinson: "Re: INSERT: Text field with single- and double-quotes"
- Reply: John Vinson: "Re: INSERT: Text field with single- and double-quotes"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|