473,378 Members | 1,475 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,378 software developers and data experts.

SELECT query with LIKE doesn't work in a program

2
This is a peculiar problem for me. I am finding that the following query works perfectly and gives the expected result set when used in the Access query design environment, but it simply gives no results at all in an otherwise functioning C# web application program:

SELECT * FROM RR_Contacts WHERE FirstName LIKE '*Robert*'

While this query works (gives a result set) with either single or double quotes etc etc using Access to execute the query, but when used within my program, no results of any kind are returned from the same database under the same conditions at the same time (more or less).

I can't see the problem. Am I nuts or missing something simple? Note that all other queries and database functions work as expected. I just can't get the LIKE clause to work in my program. Waaah!

Budsy
Oct 16 '07 #1
3 1952
FishVal
2,653 Expert 2GB
Hi, Budsy.

Try different wildcard.
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM RR_Contacts WHERE FirstName LIKE '%Robert%'
  2.  
Oct 16 '07 #2
Budsy
2
Well I'll be darned! The % wildcard worked. But I thought Access used the asterisk and not the % sign. Ah.... the variable in all this is that maybe the .NET Odbc stuff replaces the % with the * at run time. Or something.

Thanks for the tip!
Oct 17 '07 #3
FishVal
2,653 Expert 2GB
Well I'll be darned! The % wildcard worked. But I thought Access used the asterisk and not the % sign. Ah.... the variable in all this is that maybe the .NET Odbc stuff replaces the % with the * at run time. Or something.

Thanks for the tip!
I quite agree with you. That seems to be dataprovider (Jet OLEDB ?) that accepts SQL expressions in ANSI92 standard not native for Access.

Good luck.
Oct 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
4
by: Mick White | last post by:
mysql> select * from guestbook; +----+--------+---------+-----------------+----------------+ | id | fname | lname | comments | time_in |...
17
by: kalamos | last post by:
This statement fails update ded_temp a set a.balance = (select sum(b.ln_amt) from ded_temp b where a.cust_no = b.cust_no and a.ded_type_cd = b.ded_type_cd and a.chk_no = b.chk_no group by...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
9
by: Kelvin | last post by:
Okay so this is baking my noodle. I want to select all the attritbutes/fields from a table but then to excluded any row in which a single attributes data has been duplicated. I.E. Here's my...
7
by: JohnA | last post by:
Dear all, I'm trying to compose a query, but I don't know how to express the statement. I have 4 tables: Customers, Orders, Order Details and Products. Each customer has many orders and each...
5
by: parwal.sandeep | last post by:
Hello grp! i'm using INNODB tables which are using frequently . if i fire a SELECT query which fetch major part of table it usually take 10-20 seconds to complete. in mean time if any UPDATE...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
9
by: P3Eddie | last post by:
Hello all! I don't know if this can even be done, but I'm sure you will either help or suggest another avenue to accomplish the same. My problem may be a simple find duplicates / do something...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.