Advertisement

05.09.2008 at 01:39PM PDT, ID: 23390760
[x]
Attachment Details

ASP Record Set Question

Asked by sarniscool in Active Server Pages (ASP)

I have a quick question about record sets.  In the code sniplet I have an example snipplet from my application.  My question is in the line:

sql = "SELECT * FROM tbl"

If I change it to :

sql = "SELECT * FROM tbl where id = 1"

It still works.  It doesn't matter if I select everything from the database or not, because it still inserts "NEW ROW."  My thinking is that if I change the sql statement to "sql = "SELECT * FROM tbl where id = 1"" it would have wiped out my database except for ID = 1 and and the new row.  Because I thought the line takes the database stores it in the record set.  Adds a new row to the record set and then adds the whole record set back into the database.

Did I miss something?

Thanks

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
Function OpenRecordset(strSQLQuery, ConnStr)					
	Set defaultRS = Server.CreateObject("ADODB.Recordset")
	defaultRS.Open strSQLQuery, ConnStr, 3, 3
	Set OpenRecordset = defaultRS
End Function
 
set dbConn = Server.CreateObject ("ADODB.Connection")
 
dbConn.Open "Provider=SQLOLEDB.1;Initial Catalog=*****;Data Source=***;User ID=****;Password=******"
 
 
sql = "SELECT * FROM tbl"
 
set addRS = OpenRecordset(sql, dbConn)
 
addRS("comments") = "NEW ROW"
addRS.close
Set addRS = Nothing
[+][-]05.09.2008 at 03:25PM PDT, ID: 21536758

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 04:01PM PDT, ID: 21536913

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 04:01PM PDT, ID: 21536919

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 04:03PM PDT, ID: 21536929

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 08:08PM PDT, ID: 21537700

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 06:20AM PDT, ID: 21546697

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 08:10AM PDT, ID: 21547639

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 08:20AM PDT, ID: 21547731

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.12.2008 at 08:22AM PDT, ID: 21547755

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 06:21AM PDT, ID: 21554752

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 08:56AM PDT, ID: 21556333

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 07:50AM PDT, ID: 21564823

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.14.2008 at 09:23AM PDT, ID: 21565843

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 09:59AM PDT, ID: 21599523

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 10:09AM PDT, ID: 21599616

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 10:10AM PDT, ID: 21599622

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Sign Up Now!
Solution Provided By: Badotz
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.20.2008 at 11:57AM PDT, ID: 21609119

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628