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

Search in database

Ali Rizwan
925 512MB
How can i search for all records starting with the string A or any other string inputeed by user.

Thanx
Oct 26 '07 #1
6 1139
QVeen72
1,445 Expert 1GB
Hi,

Use this Query and open the Recordset:

"Select * From MyTable Where FieldName Like 'A*'"

Regards
Veena
Oct 26 '07 #2
Ali Rizwan
925 512MB
Hi,

Use this Query and open the Recordset:

"Select * From MyTable Where FieldName Like 'A*'"

Regards
Veena
Hello Veena

This is not working.
I have used this code as

Expand|Select|Wrap|Line Numbers
  1. ADATA.CommandType = adCmdUnknown
  2.     ADATA.RecordSource = "Select * From info Where Name Like '" & Text1.Text & "*'"
  3.     ADATA.Refresh
thanx
Oct 26 '07 #3
9815402440
180 100+
hi

use % in place of *

You my use _ (underscore) and % (percent) as wild cards. Use _ for one character and % for many charaters.

regards
manpreet singh dhillon hoshiarpur
Oct 27 '07 #4
debasisdas
8,127 Expert 4TB
How can i search for all records starting with the string A or any other string inputeed by user.

Thanx
use the following syntax

select * from table_name where field_name like 'A%'

if u r going for user input from textbox try this

sqlstr="select * from table_name where field_name like '" & trim(text1.text) & "%'"
Oct 27 '07 #5
rizwan6feb
108 100+
Which database you are using at the backend ?

Microsoft Access uses '*' as the wildcard character, other Databases use '%'. For me there is no problem in the query if Microsoft Access is used at the backend.
Oct 27 '07 #6
QVeen72
1,445 Expert 1GB
Hello Veena

This is not working.
I have used this code as

Expand|Select|Wrap|Line Numbers
  1. ADATA.CommandType = adCmdUnknown
  2.     ADATA.RecordSource = "Select * From info Where Name Like '" & Text1.Text & "*'"
  3.     ADATA.Refresh
thanx
Try This :

ADATA.RecordSource = "Select * From info i Where i.Name Like '*" & Text1.Text & "*'"

* at both sides, ensures, middle of the name will also be searched..

Regards
Veena
Oct 28 '07 #7

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

Similar topics

0
by: todd | last post by:
here is a search tool SP I wrote. How many times have you wanted to search all your Stored procs or views (in a database) for a keyword but couldn't!? Well now you can! THis can makes life a...
2
by: Zambo via SQLMonster.com | last post by:
Hi! We have Sql Server 2000 in our server (NT 4). Our database have now about +350.000 rows with information of images. Table have lot of columns including information about image name, keywords,...
83
by: D. Dante Lorenso | last post by:
Trying to use the 'search' in the docs section of PostgreSQL.org is extremely SLOW. Considering this is a website for a database and databases are supposed to be good for indexing content, I'd...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
1
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
1
by: Eric | last post by:
Hi: I have two files. I search pattern ":" from emails text file and save email contents into a database. Another search pattern " field is blank. Please try again.", vbExclamation + vbOKOnly...
5
by: Mark | last post by:
Hi I have an application (in vb.NET 2005) which holds data in SQL Server and some of the SQL records are simply paths to related files. I would like to be able to do a text search on both the...
6
by: shantanu | last post by:
Hi All, I have a requirement to develop a search engine based on some search criteria that will search for the string or statement in all the documents uploaded in the website. The search result...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
5
by: agarwalsrushti | last post by:
hi, This is my the search code i have tried it works well with the fiels stores as string in the database. But i have stored the qualification and specialization as int in database. Each selected...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.