By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,988 Members | 1,476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,988 IT Pros & Developers. It's quick & easy.

Search

Ali Rizwan
100+
P: 927
Hi all,
I want to know that how can i search for a Name or roll no in a database.
I m using ADODB

I want to search like this if user input M then it search for all names starts with letter M and m.
But not in case of rollno if user input 1 then it only search for 1

And if no item found then it shows message "no item found"

Please tell me how can i do this

Thanx
Dec 5 '07 #1
Share this Question
Share on Google+
2 Replies


lotus18
100+
P: 866
Hi all,
I want to know that how can i search for a Name or roll no in a database.
I m using ADODB

I want to search like this if user input M then it search for all names starts with letter M and m.
But not in case of rollno if user input 1 then it only search for 1

And if no item found then it shows message "no item found"

Please tell me how can i do this

Thanx
Hi Ali

You can use the wildcard % at the beginning of the text.

e.g.

Expand|Select|Wrap|Line Numbers
  1. Select * From <TableName> Where <FieldName> Like '%m'
. This will search the record that begins with 'm' or 'M'.

Also, placing the % at the end will search for a record in which last character ends with 'm'. You can also enclosed them with % with this example

TblStudent
Name
-John
-Mark
-Aida
-Advark

Expand|Select|Wrap|Line Numbers
  1. Select Name From <TblStudent> Where <Name> Like '%ar%'
.

Results

TblStudent
Name
Mark
Advark


BTW, What do you mean by rollno?

Rey Sean
Dec 5 '07 #2

Ali Rizwan
100+
P: 927
Thanx
Can you please tell me the whole procedure.
Actually i want to show the results as in windows search results.
Do u know about such tool?

Roll no is the number assigned to every student u can say that it is the regestration no of every student

thanx
Dec 5 '07 #3

Post your reply

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