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

avatar image

SaeidHamzehee
51 6 6 6

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

1 answer: sort voted first

The Wildcard in access is "*". Replace the "%" and it should work.

more ▼

answered Dec 31, 2010 at 01:31 PM

avatar image

dvroman
1.1k 1 4 4

(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.

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:

x52

asked: Dec 31, 2010 at 11:28 AM

Seen: 1331 times

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

Copyright 2016 Redgate Software. Privacy Policy