Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using single quotes within a string

Status
Not open for further replies.

allyeric

Programmer
Mar 14, 2000
104
0
0
CA
Visit site
Hi!

I am trying to insert a string from a textbox into my database. It works great, until it sees a SINGLE OR DOUBLE QUOTE in the string. The information from the textbox is a description field, and often the user will enter single quotes and double quotes to represent feet and inches. When the insert is called, there is an error ... of course. Is there any way to bypass this?

This is how the statement is being sent:

INSERT into catregistration values (100020, 'automatic spray gun, 5' long', 517)

Any help with this will be greatly appreciated!

Thanks
Ally

[sig][/sig]
 
its ok .. I figured it out. In case anyone is interested, I just used the Replace function, replaced the ' with the word feet.

Description(x) = Replace(Description(x), "'", " feet")

Ally
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top