Hi,
I have 2 different SQL in my ASP page. Should I create Recoedset 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
I have 2 different SQL in my ASP page. Should I create Recoedset 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