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 May 28th, 2004, 01:30 PM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ei0nN
Default ASP - Selecting Multiple Records

Hey, I have been trying to figure this out for about a day now. And to let you know, I've already googled it. So this is what I'm trying to do...

I have been trying to Select a certain amount of data from my Database.. but I want it to expand the search for my record rather than narrow it..

For Example.....
rs.open "SELECT * from users WHERE toid="&currentID&" and fromid="&CurrentID,Db1,3,3

This narrows the search so that it only selects the records that have toid and fromid = Currentid. This is the problem. I want it to select all the records that have fromid = currentid, and select all the records that have toid = Currentid.

Any Ideas? I'm fresh out. TIA

-Ei0nN
 
Old May 28th, 2004, 01:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

You got to make a big big change in your select statement.;)

Use this...

rs.open "SELECT * from users WHERE toid=" & currentID & " or fromid=" & CurrentID, Db1, 3, 3

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old May 28th, 2004, 03:38 PM
Registered User
 
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ei0nN
Default

Haha! That was fun to ponder for the past day.:D Works like a charm. Thanks gv.
Later

-Ei0nN





Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting records in a query firefighter2045 Access VBA 5 August 28th, 2008 08:14 AM
Update records with multiple keys (ASP VBScript) rbrynest SQL Server ASP 4 April 27th, 2005 05:28 AM
Update records with multiple keys (ASP VBScript) rbrynest Dreamweaver (all versions) 1 April 27th, 2005 05:11 AM
selecting records from multiple tables cygnusx04 Classic ASP Databases 1 October 28th, 2004 05:36 AM
selecting multiple records as one record array Greywacke Classic ASP Databases 1 February 10th, 2004 10:33 AM





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