Whats Is Fast For Setting Recordset !

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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: ...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139