Wrox Programmer Forums
|
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 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
  #1 (permalink)  
Old February 15th, 2004, 01:20 PM
Authorized User
 
Join Date: Feb 2004
Posts: 57
Thanks: 0
Thanked 0 Times in 0 Posts
Default multiple recordset or only one

Hi,

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 ?

Thanks

******************
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"
else
    profileidfound= "yes"

end if
set rsEvents=nothing

str=""
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"
else
    emailfound= "yes"
end if

set rsEvents1=nothing







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





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