Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database search

Status
Not open for further replies.

mattdillane

Programmer
Mar 31, 2000
1
US
How do you do a wildcard search<br>e.g.<br>*.*abc123<br>I have the find first code etc, but cannot find anything to do with this.
 
Here is an outline of the code :<br><br>Dim strCond, strSQL as String<br><br><br>strSQL= &quot;select * from tablea where fieldname like '%&quot;<br><br>strCond = &quot;abc&quot; <br>'Where abc is the part string you are looking for<br><br>strSQL = strSQL & strCond & &quot;%'&quot;<br><br>Set adoRS = adoComm.execute strSQL
 
<br><br>O.K. In SQL Server you use the character '%' for wild card searches; as in : <br>&quot;Select * from [thetable] where name like 'Ami%'&quot;<br>If I'm in there it'll find me.<br><br>In MS Access you use the character &quot;*&quot; for wild card searches. Therefore with the statement:<br>&quot;Select * from [thetable] where name like 'Ami*'&quot;<br>If I'm in there it'll find me.<br><br>Or even (In Access)...<br>&quot;Select * from [thetable] where name like '*el'&quot;<br>If I'm in there it'll find me.<br><br>Have Fun !<br><br><br> <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top