Ask a Question related to ASP Database, Design and Development.
-
Lovely Angel For You #1
Whats Is Fast For Setting Recordset !
Dear Friends
Hope you all doing great.
Few days ago I asked you all for a coment on using Access and ASP. I
got many replies. In one of the replies, Dear Tom B, suggested me to
use Code One for setting recordsets.
And he also suggested me to use OLEDB connection instead of the one I
am using now.
Please comment on this.
Which one is faster. Which one works better in what kind of scenerio.
What are the benefits of having OLEDB connection instead of one like
below.
Set objConn = Server.CreateObject("ADODB.Connection")
Set rs_Current = Server.CreateObject("ADODB.Recordset")
objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath("all.mdb")
'Code One
Set rs_Current=objConn.Execute("SELECT Article.Name, Article.ID FROM
Article WHERE SubjectID=10")
OR
'Code Two
rs_Current.Open "SELECT Article.Name, Article.ID FROM Article WHERE
SubjectID=10", objConn
Waiting for your replies.
Love
Lovely
---------------------------------
Lovely Angel For You Guest
-
Setting javascript variable from a recordset
I am trying to do something that's probably pretty simply. All I am trying to do is set a variable from a recordset. The code I am using is: ... -
Slow printing on fast copier but fast printing on slow printer!
I am seeing this exact issue. I have a Windows 2003 print server (also a domain controller), Windows XP pro desktops (all updates), Adobe 6.0.1 and... -
Whats my RecordSet doing?
Hi All I'd just like to confirm something with you if you don't mind. Basically when my ASP page contains 3 or 4 queries, in my own little... -
RecordSet.Move or RecordSet.AbsolutePosition??
Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to... -
whats the best way to?
write one function (for navigation) and call it in multiple asp.net pages? - i would use an include file as i do in asp but i gather this isnt the... -
Ray at #2
Re: Whats Is Fast For Setting Recordset !
My GUESS is code 1, but drop the "set
rs_current=server.createobject("adodb.recordset"). "
It seems to me that the longer you put off the creation of an object, the
less time it'll spend in memory, so the faster things will be. Like, this
is why I do:
sSQL = "select whatever"
set adoObject = server.createobject("adodb.connection")
Set rs = adoObject.execute(sSQL)
as opposed to
set adoObject = server.createObject("adodb.connection")
sSQL = "select whatever"
Set rs = adoObject.execute(sSQL)
I won't create an object until I am ready to use it. I'd rather have a
string of SQL floating around in memory for a few extra lines than an
object. Have I done any benchmark testing or research? No. But it just
makes sense to me in a scripting language.
Ray at work
"Lovely Angel For You" <lovely_angel_for_you@yahoo.com> wrote in message
news:55295a7e.0307011100.6004eee8@posting.google.c om...> Dear Friends
> Hope you all doing great.
>
> Few days ago I asked you all for a coment on using Access and ASP. I
> got many replies. In one of the replies, Dear Tom B, suggested me to
> use Code One for setting recordsets.
> And he also suggested me to use OLEDB connection instead of the one I
> am using now.
>
> Please comment on this.
>
> Which one is faster. Which one works better in what kind of scenerio.
> What are the benefits of having OLEDB connection instead of one like
> below.
>
> Set objConn = Server.CreateObject("ADODB.Connection")
> Set rs_Current = Server.CreateObject("ADODB.Recordset")
> objConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" &
> Server.MapPath("all.mdb")
>
> 'Code One
> Set rs_Current=objConn.Execute("SELECT Article.Name, Article.ID FROM
> Article WHERE SubjectID=10")
>
> OR
>
> 'Code Two
> rs_Current.Open "SELECT Article.Name, Article.ID FROM Article WHERE
> SubjectID=10", objConn
>
>
> Waiting for your replies.
>
> Love
> Lovely
>
> ---------------------------------
Ray at Guest



Reply With Quote

