Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 October 1st, 2003, 07:53 AM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems With returning records through ADO

I am using classic ASP and an MS Access database which is in 2000 format. My problem is as follows - I have 2 tables in the db which I want to join through a query, I create a query as follows :

SELECT * FROM StoreList INNER JOIN techEnquiry ON StoreList.pkStore=techEnquiry.pkStore
WHERE StoreName LIKE '*S*';

WhenI run this through MS Access's Query Analyser (Don't know what else to call it?) It works fine and returns all records with 'S' in the StoreName. WhenI run the same request through ADO in an ASP page I get no records returned.

I am using the Microsoft Jet 4 Driver, I have MDAC 2.7 RTM (Although I have also used 2.5 with the same problem)

Has anybody else had problems like this?

any help appreciated

Marko

 
Old October 1st, 2003, 10:28 AM
Registered User
 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

¿´µÃ²»Ì«Ã÷°×,ÎÒÖйúÈË,Ó¢Óï ²»ÐÐ,²»È»¿ÉÒÔhelp you µÄ.sorry

 
Old October 1st, 2003, 11:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The problem is caused by the ADO layer between your page and Access. Although Access usually requires the * as a wild card, for ADO you should pass the percentage symbol. This:
Code:
SELECT * FROM StoreList INNER JOIN techEnquiry ON StoreList.pkStore=techEnquiry.pkStore
WHERE StoreName LIKE '%S%'
should do the trick.

You can also leave the semi-colon at the end, if you want.

Cheers,

Imar




---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old October 1st, 2003, 01:07 PM
Registered User
 
Join Date: Oct 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you so Much, I was just about to give up as well!
This brings me to the point of what I was doing originally and that was using a stored query in the MS Access DB. The stored query was just like the query I posted and that worked in Access Query Analyser but not through the code, I have now got the query working passing in direct as a query with %'s instead of *'s. If I now alter the Stored Query and use %'s it works through ADO but not through the MS Access Query Analyser - I can definitely live with that one.

Thank you again.

 
Old September 29th, 2004, 01:56 PM
Registered User
 
Join Date: Sep 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a similar question and can't figure out what I'm doing wrong. I'm running SQL Server 2000 and in Query Analyser, I'm trying to write an "update" string and it won't updat my records. Here is the line : update INMAST set FPRODCL ='S1' where fpartno = '*r'

I have tried '%r', '*r', and '&r'. All say 0 rows updated. Any thoughts?

 
Old September 30th, 2004, 04:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you want to use wildcards you must use LIKE not =
...WHERE fpartno LIKE '%r'
will update all records where fpartno ends in 'r'





Similar Threads
Thread Thread Starter Forum Replies Last Post
Query returning all records - why? Toiletbrush Infopath 1 November 21st, 2007 03:19 AM
help on returning records memewang Crystal Reports 0 April 14th, 2007 08:48 PM
Query returning No Records englandera Classic ASP Databases 2 November 22nd, 2004 10:54 AM
Returning record in stored function with ADO nmbarbillo Oracle 0 June 15th, 2004 12:36 PM
Returning resultset to ADO.NET dataset gp_mk Oracle 3 December 22nd, 2003 10:44 AM





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