There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
blue screen boot bsod computer connection crash css dell display driver drivers email error ethernet excel firefox firefox 3 game hard drive hardware internet internet explorer itunes laptop lcd malware monitor network networking outlook outlook 2003 outlook express partition password printer problem problems router security slow sound sprtcmd.exe trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
"D'Unger" in an SQL statement - Help


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
wango's Avatar
Member with 74 posts.
 
Join Date: Nov 2001
Location: Silver 'Spring
11-Nov-2003, 09:34 PM #1
"D'Unger" in an SQL statement - Help
How do I handle a name like "D'Unger" with an apostrophe in it as in O'Neill". I am using SQL and C/C++ to input migrate data from one database to another. i am runing into trouble everytiome I bump into name like "D'Unger". What is the solution?

// 11.16.2002 modified
strcpy((char *) SQLStmt, "SELECT * FROM IPM_FROM_PADDINGTON.dbo.Personnel WHERE ");
strcat((char *) SQLStmt, "FName = '");
strcat((char *) SQLStmt, visa1elements.rowElem1_Stg_First_Name);
strcat((char *) SQLStmt, "' AND LName = '");
strcat((char *) SQLStmt, visa1elements.rowElem1_Stg_Last_Name);
strcat((char *) SQLStmt, "'");
__________________
Wango
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
11-Nov-2003, 10:37 PM #2
Double the single quote character in the select statement. That will require some creative editing of the string but the way it should look in the SQL is D''Unger
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:23 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.