473,796 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to search "O'Neal" using SQL

I have my access database with a list of student's names, some student has
the name as O'Neal.. when i am doing a search in my windows applicaiton sql
queries, i couldn't search for it coz it will throw a syntax error exception
(the sql is: SELECT * FROM tblStudent WHERE Name='O'Neal';)

Since there is a quote in between the name, it throws a syntax error.. i was
told by my friends that i can use three quotes to get around this but the
exception still comes up...
Is there any way to aviod this?
Thanks
Nov 15 '05 #1
1 1776
Hi Tony

Tony wrote:
I have my access database with a list of student's names, some student has
the name as O'Neal.. when i am doing a search in my windows applicaiton sql
queries, i couldn't search for it coz it will throw a syntax error exception
(the sql is: SELECT * FROM tblStudent WHERE Name='O'Neal';)
I propose: SELECT * FROM tblStudent WHERE Name='O''Neal';

Use two single-quote chars works in my ADODC experience.
Since there is a quote in between the name, it throws a syntax error.. i was
told by my friends that i can use three quotes to get around this but the
exception still comes up...
Is there any way to aviod this?
Thanks


Regards

Marcin Grzębski

Nov 15 '05 #2

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

Similar topics

17
2393
by: Geoff Cox | last post by:
Hello, I am trying to have 1. web pages in large font 2. web pages with smaller font for printing I am using <link rel="stylesheet" media="print" type="text/css"
10
2284
by: Matt Adams | last post by:
A web page which exists for a couple of years under a certain address (e.g. http://www.aaa.com/bbb/ccc.html) is (should be) moved to another location (e.g. http://www.newloc.com/ddd/eee.html) Ok. I could replace the ccc.html by another page which forwards the user to the new page. However what I want to achieve ist that the search engines should
5
3006
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine (a wicked phrase). Some but not all of the words of that phrase exist in my website. I reported it and they removed the link but did not give explanations.
24
5836
by: Mohammd M. Hussain | last post by:
Hi, I am writing an XHTML 1.0 Strict Compatible web page. However, the validator complained about the <br> tag. I wonder whether there is another alternative for this. Thanks,
4
2337
by: Bill | last post by:
I'm putting together a very simple web page with radio buttons that indicate the status of an item. The page won't be viewed except by 10 or so viewers inside a network. I want the viewers to be able to click a radio button and then for that button to stay "clicked" when the page is viewed again later - when the next viewer will click another button to indicate the new status. I'm not having any luck finding code to help me do this. I can...
15
2511
by: Rob Evans | last post by:
Is there a way of stopping " - Microsoft Internet Explorer" being added to the browser window title ? eg, I want it to say: My Website Name and not My Website Name - Microsoft Internet Explorer I have added full stops (periods) but this looks messy:
27
5092
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I would just as soon place the employer in control of what directory he wishes to save it in, and there are two salient reasons for this: 1. I want him to OWN the document 2. I want him to FIND the document, quickly, on his hard drive In any...
11
2648
by: Steve | last post by:
Is it possible to "dock" a menu, to basically achieve the same effect as frames without using frames? Is JavaScript required(to continually reposition the element), or can it all be achieved using CSS? Thanks, Steve
3
4979
by: DotNetJunkies User | last post by:
I am getting the "This type of page is not served." error the first time I access our asp.net site after an application restart. The second and every other time it works fine. This application has been working for months and recently started this behaviour and we can't figure out why. Can onyone point me in the right direction? --- Posted using Wimdows.net NntpNews Component - Post Made from http://www.DotNetJunkies.com/newsgroups Our...
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10461
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10239
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10190
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10019
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9057
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.