Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Wrox Announcements and Feedback > All Other Wrox Books
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books 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
Closed Thread
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 15th, 2004, 01:20 PM
Authorized User
Join Date: Feb 2004
Location: , , .
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default multiple recordset or only one


I have 2 different SQL statments in my ASP page. Should I create Recordset object 2 different times like I am doing down. Or Should I just make Recordset object only once and use same for all the SQL statements, which one is right and efficient way ?


Set Conn=Server.CreateObject("ADODB.Connection")
Set rsEvents = server.CreateObject("ADODB.Recordset")

Conn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=AStrongSAPwd;Initial Catalog=matrimonialSQL;Data Source=irfan-ne8ldmk8y;Initial File Name=D:\Program Files\Microsoft SQL Server\MSSQL\Data\matrimonialSQL.mdf"
str = "Select profile_id from customer_profile where profile_id ='" & profileid & "'"

rsEvents.Open str, Conn
if rsEvents.EOF Then
    profileidfound = "no"
    profileidfound= "yes"

end if
set rsEvents=nothing

str = "Select email_address from customer_profile where email_address ='" & emailaddress & "'"

Set rsEvents1 = server.CreateObject("ADODB.Recordset")
rsEvents1.Open str, Conn

if rsEvents1.EOF Then
    emailfound = "no"
    emailfound= "yes"
end if

set rsEvents1=nothing

Closed Thread

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
Clone DAO Recordset into ADO Recordset kamrans74 VB How-To 0 March 6th, 2007 11:57 AM
listbox recordset multiple pages vaguy02 VBScript 1 June 21st, 2005 06:21 AM
ADODB.Recordset (0x800A0CB3)Current Recordset does tks_muthu Classic ASP Databases 0 June 16th, 2005 07:22 AM
Convert ADO recordset to DAO recordset andrew_taft Access 1 May 5th, 2004 02:31 PM
multiple recordset or only one isheikh Classic ASP Databases 4 March 5th, 2004 01:02 PM

All times are GMT -4. The time now is 12:54 PM.

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