473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Apostrophe Problem - HELP

I have a database with a vb.net frot end that I have used forever

recently we upgraded our database server to SQL 2005 x64
in my code i run

mystring= Replace(mystring, "'", "''")

to replace any single apostrophes with 2 apostrophes

in the last couple of weeks its actually started storing 2 apostrophes in
the database

e.g Mike's stores into the database as Mike''s

it never did this before and im totally baffelled as to why its happening

any help would be greatly appreciated

Thanks

Mike
Dec 7 '06 #1
3 1190
Are you talking about an INSERT command?

Can you show the code lines where you do that ?

-T

Mike Fellows ha scritto:
I have a database with a vb.net frot end that I have used forever

recently we upgraded our database server to SQL 2005 x64
in my code i run

mystring= Replace(mystring, "'", "''")

to replace any single apostrophes with 2 apostrophes

in the last couple of weeks its actually started storing 2 apostrophes in
the database

e.g Mike's stores into the database as Mike''s

it never did this before and im totally baffelled as to why its happening

any help would be greatly appreciated

Thanks

Mike
Dec 7 '06 #2
e.g Mike's stores into the database as Mike''s
How does it look when it comes out of the database, such as using a
SELECT? does a SELECT return "Mike's" or "Mike''s"?

Dec 7 '06 #3
Mike Fellows wrote:
in the last couple of weeks its actually started storing 2
apostrophes in the database
If you're using an INSERT or UPDATE statement, take a look at the SQL you're
actually executing. Make sure the quotes haven't been doubled up twice,
which would result in the behaviour you describe.

If you're putting the values into a DataTable, don't double up the
apostrophes at all -- the DataAdapter object will take care of doing
anything like this that is required for you automatically.

HTH,

--

(O)enone
Dec 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: S. Rhodes | last post by:
Hello everyone. I am TOTALLY baffled. PLEASE, I need some help here. In the event that one must deal with a name including an apostrophe...I am looking for an appropriate solution. The...
2
by: InvisibleMan | last post by:
Thank in advance for your help... I have the following javascript: document.write(' <a class="whitenav" href="javascript:window.external.AddFavorite ('http://www.mydomain.com','Welcome to...
1
by: Joel | last post by:
I realize there are many ways to handle Apostrophes in sql statements. The problem I'm having is comparing a string with an Apostrophe entered by the operator against the field in the DB (ie Field:...
2
by: CSDunn | last post by:
Hello, I have a combo box designed to look up records in a subform based on the selection made in the combo box. The Record Source for the combo box is a SQL Server 2000 View. There is one bound...
13
by: Richard Hollenbeck | last post by:
To prevent future apostrophe bugs and errors, isn't it just simpler to forbid an apostrophe from being entered into a text field? For example, couldn't "Alice's Restaurant" be changed to "Alices...
3
by: spacehopper_man | last post by:
hi - I am "apostrophe in sql" problems ;) I am executing a stored procedure on SQL Server - and passing in a string parameter. the string has a single apostrophe in it. the call is...
1
by: Rose | last post by:
Hi all, I'm trying to create a clickable link, but the pesky apostrophe is preventing the link from getting displayed properly. I'm displaying the contents of a folder (with contains the...
2
by: Tom | last post by:
Hi, I have some kind of problems with an apostrophe character ('). I would like to select from DataTable DataRow containing value horses' (with an apostrophe on the end). But when I do it in an...
9
by: dajava | last post by:
Hi, Sorry for this beginner's question. I do not know PHP and write for my friend. He has never been a professional programmer. He studied C and PHP with some books and made a bulletin...
9
by: Thomas 'PointedEars' Lahn | last post by:
Jukka K. Korpela wrote: IBTD. For example, in English it is customary (and AIUI expected) to use the character that ’ represents should be used to delimit a quotation within direct speech...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.