473,405 Members | 2,294 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,405 software developers and data experts.

Entering single quote into a database expl (O'Hare)

How can I insert a field name like O'Hare or O'Conner into a table. I would rather not have to check every field entered to see if the character ( ' ) is in the field. I'm entering Streets, Names, Clients, etc. into a table. Everything was going fine until the Name field (O'Hare) was entered. Can I somehow map the Chr$(39) to Chr$ (96)? Any suggestions?
Nov 20 '05 #1
3 1193
* "=?Utf-8?B?Qm9iIEU=?=" <an*******@discussions.microsoft.com> scripsit:
How can I insert a field name like O'Hare or O'Conner into a table. I
would rather not have to check every field entered to see if the
character ( ' ) is in the field. I'm entering Streets, Names, Clients,
etc. into a table. Everything was going fine until the Name field
(O'Hare) was entered. Can I somehow map the Chr$(39) to Chr$ (96)? Any
suggestions?


Try "\'" or "''".

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Hi Bob,

I have had no trouble appending a row, and the assigning a value:

irow("lname") = irow_("lname")

The assigned value comes from the 'other' table. What am I missing here?

Bernie Yaeger

"Bob E" <an*******@discussions.microsoft.com> wrote in message
news:45**********************************@microsof t.com...
How can I insert a field name like O'Hare or O'Conner into a table. I

would rather not have to check every field entered to see if the character
( ' ) is in the field. I'm entering Streets, Names, Clients, etc. into a
table. Everything was going fine until the Name field (O'Hare) was entered.
Can I somehow map the Chr$(39) to Chr$ (96)? Any suggestions?
Nov 20 '05 #3
Bob,

If you're running SQL statements like:

"INSERT INTO Users (Name, Address) values ('" & szName & "','" & szAddress &
"')"

consider using parameters instead. They should handle all the problems with
single quotes, number and date formats etc.

Your SQL statement would change to:
"INSERT INTO Users (Name, Address) values (?,?)"

and add the parameters in the proper order to the parameters collection of
the command object.

You may find more help by posting in
microsoft.public.dotnet.framework.adonet

HTH,

Trev.

"Bob E" <an*******@discussions.microsoft.com> wrote in message
news:45**********************************@microsof t.com...
How can I insert a field name like O'Hare or O'Conner into a table. I

would rather not have to check every field entered to see if the character
( ' ) is in the field. I'm entering Streets, Names, Clients, etc. into a
table. Everything was going fine until the Name field (O'Hare) was entered.
Can I somehow map the Chr$(39) to Chr$ (96)? Any suggestions?
Nov 20 '05 #4

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

Similar topics

4
by: Shock | last post by:
Hi everybody, I have been getting so much good advice here that I figured I would post another question. I am still learning c++ from a text that I inherited from my brother. I am now working...
0
by: bob .net | last post by:
Server exploI have recently installed Visual Studio .Net 2002 on my workstation running XP Professional. I can connect to local Access and MSDE databases successfully using ADO .Net. I can also...
2
by: David Bird | last post by:
I am attempting to build a command string to update a field in a dataset. the command string looks like this: Dim cmdString As String = "Update set lName = '" & clName.Trim & "', fName = '" &...
12
by: Ray | last post by:
I just completed a database and would like to prepare the documentation for it. As I have no experience to do so, can someone advise me the essential elements for the documentation and any example...
10
by: Vince | last post by:
The following is code for the classic tortoise and hare C assignment. I am posting this for educational purposes only. Please do not plagiarize as comp sci instructors regularly read newsgroups....
0
by: Buckaroo Banzai | last post by:
Hello, newbie here... I'm writing this program but when I click the start button which should initiate either the Hare or the Tortoise, it does not, this is the first time I use threads, so the...
4
by: dirk | last post by:
Hey, I'm new to php and I'm trying to write some php code so that I can insert data into a mysql database using html forms. I've got two text forms and a submit button. When entering data and...
12
by: ghd | last post by:
Hare Krishna, Hi, I wanted to know if C# has a facility whereby i can define one single implementation for a method that is used by two different classes in two different class heirarchies? Now...
4
by: Neil | last post by:
Having trouble with inserting a record into a table. It's a list of names. But, for some reason, it won't take a particular name. When a user tries to enter a name into the table, the system hangs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.