x

How Can I use Like parameter in where with Oledb to search in Access

I need to search some record in access with Like filtering, but it doesn't work with OleDBconnection and with access database. I used

select * from Customer where Customer_Name Like '*" + Textbox1.text + "*'" 

I had experience with SQL database and Ado and SQLConnection for several time like this

select * from Customer where Customer_Name Like '%" + Textbox1.text + "%'" 

and it worked without any problem, but with OleDBconnection and access database I have problem, Could I ask you help me in this regard.

Thank you In advance
more ▼

asked Dec 31, 2010 at 11:28 AM in Default

SaeidHamzehee gravatar image

SaeidHamzehee
51 6 6 6

(comments are locked)
10|1200 characters needed characters left

1 answer: sort oldest
The Wildcard in access is "*". Replace the "%" and it should work.
more ▼

answered Dec 31, 2010 at 01:31 PM

dvroman gravatar image

dvroman
1.1k 2 2

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x49

asked: Dec 31, 2010 at 11:28 AM

Seen: 1052 times

Last Updated: Jan 01, 2011 at 12:34 PM