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!

How do I include the apostrophe?

Status
Not open for further replies.

rkinrade

Programmer
Feb 1, 2003
19
0
0
US
When wanting to insert info from a textbox such as "John's Store", how would I include the apostrophe in John's without the SQL statement crashing?
 
Thanks, actually the code is being run from VB and looks something like this: insert into stores(name) values ('" & txtCustInfo(1).Text & "'). The value of txtCustInfo(1).Text being "John's Store". I guess what I need is VB code to replace the apostrophe before sql gets it.
 
Code:
Replace(txtCustInfo(1).Text, "'", "''")

You should really post these questions in the VB forum in future.

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top