Hi it's me again. I have some more questions. I feel like a parasite for just making questions, I'd like to help other people too but, by now, my knowledge is very scarce
Well, my questions (mainly regarding the recordsets):
1) Is it different to "build" a recordset object like this:
or like this:
Are they the same?
2) Can I "fill" the same RecordSet object more than once in the same page for 2 different tasks? For example:
...(data processing)...
...(data processing)...
It seems it works but I don't know if, eventually, I might get corrupted data for "setting" it 2 times...
3) How much important is to do a rs.close and conn.close (to close a recordset and connection object) at the end of the document (or when I'm done with them). What could happen if I do not explicitly close them?
4) This one is not about recordsets. I have written some kind of "mini" search function (I use asp with VBscript). It works, but I have had to do something like this to compare every set of text strings:
, because I realised the comparison was case sensitive, so I have "standardized" the case to lower when comparing. Is this just a "dirty workaround" for it, or it is an acceptable tecnique?
Thanks for any answers to my questions
ChampionX
Well, my questions (mainly regarding the recordsets):
1) Is it different to "build" a recordset object like this:
Code:
set rs = conn.Execute(SQL)
or like this:
Code:
set rs = Server.CreateObject ("ADODB.Recordset")
rs.Open SQL, Connection
2) Can I "fill" the same RecordSet object more than once in the same page for 2 different tasks? For example:
Code:
SQL="Select * from table1"
set rs = conn.Execute(SQL)
Code:
SQL="Select fieldone, fieldtwo from table2"
set rs = conn.Execute(SQL)
It seems it works but I don't know if, eventually, I might get corrupted data for "setting" it 2 times...
3) How much important is to do a rs.close and conn.close (to close a recordset and connection object) at the end of the document (or when I'm done with them). What could happen if I do not explicitly close them?
4) This one is not about recordsets. I have written some kind of "mini" search function (I use asp with VBscript). It works, but I have had to do something like this to compare every set of text strings:
Code:
if LCase(string1)=LCase(rs.fields("field_one")) then ...
, because I realised the comparison was case sensitive, so I have "standardized" the case to lower when comparing. Is this just a "dirty workaround" for it, or it is an acceptable tecnique?
Thanks for any answers to my questions
ChampionX