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 June 29th, 2004, 04:33 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default Finding records within Access

i hav a problem finding records within an access database using minimal specifications, by which i mean that i'm looking for something like something within something. the problem is that i'm not allowed to use sql, so for this purpose i'm using ado-definitions and the "Find" function supplied by asp.

this is basically the situation i find myself in. i'm looking for anything that has to do with "21" contained within a field called "Codes". the problem is that the field "Codes" consists of values ranging from "SPKCR2101" to "SPKCR71100" now i would like to know how to display only the values "SPKCR2101" to "SPKCR21100" and not the rest using the "FIND" option.

please help

michael j hemmington
__________________
michael j hemmington
 
Old June 29th, 2004, 10:28 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Use wildcards in your criteria string as in:

yourRS.Find "Codes LIKE '*21*'"

 
Old June 30th, 2004, 01:53 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default

i'll have a look, thnx

michael j hemmington
 
Old June 30th, 2004, 02:15 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default

seeing that i'm not using an sql-connection to the database, but a standard OLEDB i can't use the "LIKE" in my find which results in an error message. i've been playing around with some control-statements, now would it be possible to look for only records matching let's say "CR21", by using the "InStr" command?

michael j hemmington
 
Old June 30th, 2004, 02:19 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:seeing that i'm not using an sql-connection to the database, but a standard OLEDB i can't use the "LIKE" in my find which results in an error message....
That cannot be because of the type of connection that you use, it should me due to something that you are missing. Can you post the code that you are trying to play around, also the error that you see?

_________________________
- Vijay G
Strive for Perfection
 
Old June 30th, 2004, 02:59 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default

i found my problem, i was referring to a query but called up the wrong ado-string "adCmdTQuery" so it kept on giving me that error, thnx. but i'm stuck with a new problem! i find all the records i'm looking for but when i loop them out, using a while loop it displays all the records in the database. knowing about this i want to take out the while-loop and replace it with a for-loop, will it work?

michael j hemmington
 
Old June 30th, 2004, 03:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

No. FOR / WHILE doesn't make any difference with what you get displayed. Anything that is populated in the recordset would be displayed always, either you use While or For loop.

So, it should be something wrong with the Query that you used.

But, how you say that you are seeing the rows that are needed? You checked that executing your query directly on the SQL right?

If so, you can check your ASP code, to see if you use something different from what you used in SQL server. Or once again, you might be referring from a another recordset.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old June 30th, 2004, 03:39 AM
Authorized User
 
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Pharasite Send a message via Yahoo to Pharasite
Default

this is the funny thing, as my client is limited to virtual space i'm stuck with ms access. the query was the problem so i deleted it and is referring back to my table called "Stuff". i basically fixed this problem but is stuck with a new one message: "Number of records". if i can't solve this problem my client will only be left with sql and sql server, which they dont' want.

thnx

michael j hemmington





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM
Finding Records Itzamna VB Databases Basics 3 June 7th, 2005 10:44 AM
finding total no. of records reshmisworld Classic ASP Databases 4 July 24th, 2003 06:35 PM
finding total no. of records reshmisworld Classic ASP Databases 1 July 24th, 2003 03:23 PM





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