p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: SQL Wildcard for Access DB


Message #1 by REdwards@c... on Thu, 13 Jun 2002 23:10:53
I am having problems trying to use a wildcard in an SQL statement on an 
Access DB. I want to do a simple search and this is not working

"SELECT * from TableName WHERE Name LIKE 'Jim*' ORDER BY ID;"

It just returns no records. I have used a wildcard before on a Filter and 
it worked perfectly:

oRS.Filter = "Name LIKE 'Jim*'"

Do SELECT statements work with wildcards?

Thanks,

Robert
Message #2 by "Drew, Ron" <RDrew@B...> on Fri, 14 Jun 2002 07:49:44 -0400
"SELECT * from TableName WHERE Name LIKE 'Jim%' ORDER BY ID;"

-----Original Message-----
From: REdwards@c... [mailto:REdwards@c...]

Sent: Thursday, June 13, 2002 7:11 PM
To: ASP Databases
Subject: [asp_databases] SQL Wildcard for Access DB


I am having problems trying to use a wildcard in an SQL statement on an
Access DB. I want to do a simple search and this is not working

"SELECT * from TableName WHERE Name LIKE 'Jim*' ORDER BY ID;"

It just returns no records. I have used a wildcard before on a Filter
and
it worked perfectly:

oRS.Filter =3D "Name LIKE 'Jim*'"

Do SELECT statements work with wildcards?

Thanks,

Robert
Message #3 by Shawn_McCabe@c... on Thu, 13 Jun 2002 16:39:41 -0700
Usually it is.
This is the SQL statment I used and It works fine.
 MYSQL = "SELECT * FROM OSOBJAH WHERE (((OSOBJAH.OSOBJAH_OBJECT_ID) LIKE 'UZCF%'))"



From: REdwards@c... on 06/14/2002 12:46 AM GMT

Please respond to "ASP Databases" <asp_databases@p...>

To:       "ASP Databases" <asp_databases@p...>
cc:

Subject:  [asp_databases] Re: SQL Wildcard for Access DB


That produces an error. I thought % was for Oracle DB's? My page is
hitting an Access DB.

>
Try using % instead of *








Message #4 by "Ken Schaefer" <ken@a...> on Fri, 14 Jun 2002 10:44:03 +1000
www.adopenstatic.com/faq/likequeries.asp

% is the ANSI SQL standard for 1+ wild card characters
* is Jet SQL

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <REdwards@c...>
Subject: [asp_databases] Re: SQL Wildcard for Access DB


: That produces an error. I thought % was for Oracle DB's? My page is 
: hitting an Access DB.
: 
: > 
: Try using % instead of *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Message #5 by REdwards@c... on Fri, 14 Jun 2002 00:46:44
That produces an error. I thought % was for Oracle DB's? My page is 
hitting an Access DB.

> 
Try using % instead of *


Message #6 by Shawn_McCabe@c... on Thu, 13 Jun 2002 15:48:57 -0700
Try using % instead of *




From: REdwards@c... on 06/13/2002 11:10 PM GMT

Please respond to "ASP Databases" <asp_databases@p...>

To:       "ASP Databases" <asp_databases@p...>
cc:

Subject:  [asp_databases] SQL Wildcard for Access DB


I am having problems trying to use a wildcard in an SQL statement on an
Access DB. I want to do a simple search and this is not working

"SELECT * from TableName WHERE Name LIKE 'Jim*' ORDER BY ID;"

It just returns no records. I have used a wildcard before on a Filter and
it worked perfectly:

oRS.Filter = "Name LIKE 'Jim*'"

Do SELECT statements work with wildcards?

Thanks,

Robert







  Return to Index