Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
| Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 16th, 2004, 06:36 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Whitstable, , United Kingdom.
Posts: 121
Thanks: 0
Thanked 0 Times in 0 Posts
Default 'like' problem with asp.net/ ado


I have a simple asp.net webpage that uses a bound datagrid
via a .net ado connection.

I have a problem with a query that runs when I use under my Access
2002 query builder pane but does not run when I use it via my
ado connection. the query syntax is as follows:

'select * from employees where firstname like '*ste*'

under the Access query pane I get all employees whose first name
contains 'ste' ( eg stephen, steve, steven, etc)

However when I run this query under ado - I get no records returned.
Should I use different wildcards ( ie '*' characters ) under ado ?

Any suggestions much appreciated.
Cheers
Chas.



 
Old September 16th, 2004, 06:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Use % instead (http://www.adopenstatic.com/faq/likequeries.asp)
 
Old September 16th, 2004, 01:50 PM
Friend of Wrox
 
Join Date: Jul 2003
Location: South San Francisco, CA, USA.
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

Chas,
I think your syntax problem is the use of single quotes (').
You can't have 3 single quotes in your query, you should use
combination of double and single quotes in pairs. More than
1 pair should be excaped.
John






Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO.Net Problem akhilesh_g ASP.NET 2.0 Professional 2 December 18th, 2007 05:33 AM
Can you use Asp 3.0 with ADO.NET? handles Classic ASP Basics 0 September 30th, 2005 07:37 PM
Ado.net Problem... NitinJoshi General .NET 2 January 10th, 2005 04:49 AM
ADO.NET Problem lakmaldp ADO.NET 1 July 15th, 2004 01:58 AM
ADO.NET Problem dfb78 Classic ASP Databases 1 June 5th, 2003 05:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.