 |
| 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
|
|
|
|

June 29th, 2004, 04:33 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 29th, 2004, 10:28 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2003
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Use wildcards in your criteria string as in:
yourRS.Find "Codes LIKE '*21*'"
|
|

June 30th, 2004, 01:53 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i'll have a look, thnx
michael j hemmington
|
|

June 30th, 2004, 02:15 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 30th, 2004, 02:19 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

June 30th, 2004, 02:59 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

June 30th, 2004, 03:26 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

June 30th, 2004, 03:39 AM
|
|
Authorized User
|
|
Join Date: Jun 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|
 |