Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 1st, 2003, 07:53 AM
Registered User
 
Join Date: Oct 2003
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old October 1st, 2003, 10:28 AM
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #3 (permalink)  
Old October 1st, 2003, 11:09 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #4 (permalink)  
Old October 1st, 2003, 01:07 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
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.

Reply With Quote
  #5 (permalink)  
Old September 29th, 2004, 01:56 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
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?

Reply With Quote
  #6 (permalink)  
Old September 30th, 2004, 04:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
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'
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:15 PM.


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