connect to the data source with or without Connection object

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

  1. #1

    Default connect to the data source with or without Connection object

    To connect the ASP application to data source, we can use ADO.Connection
    object

    Const connectionString = "Provider=Microsoft.Jet.OLEDB.3.51; Data
    Source=C:\mydatabase.mdb;"
    Dim objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    ....
    objConn.Open connectionString
    objRS.Open sqlStatement, objConn '----------------- (1)


    The alternative is we can open the connection directly with ADO.RecordSet
    object, without using ADO.Connection object.

    objRS.Open sqlStatement, connectionString '---------------(2)


    What's the differences between line (1) and (2)? I read a book saying using
    Connection object is expensive, but I don't got it since there is connection
    anyway by using RecordSet object.

    Please advice. Thanks
    John


    John Davis Guest

  2. Similar Questions and Discussions

    1. Data Source Connection Verification Fails
      I have been trying for hours to get Cold Fusion admnistrator to accept my data souce. I am using SQL Server 2000 on my development computer. Databse...
    2. Connection to data source error
      Hi, For the past week I am continually getting disconnected from my data source in cold fusion, and have to reconnect. But when I go to do that,...
    3. Data Source Connection Problems -- CF6 and CF7
      We have doing development locally running CF6 on a local XP SP2 machine with the latest version of the MS MSDE server. When we installed CF6 last...
    4. DB Connection Error: Data source name not found
      Hei, I am using Dreamweaver MX 6.1, XP SP2 and trying to connect to a MS Access db. I can open & preview the page & data correctly using IIS...
    5. ASP Data Source Connection Help
      I am trying to create a connection in my ASP page to a SQL Server database. This is my code for the connection string: <%Option Explicit%> <%...
  3. #2

    Default connect to the data source with or without Connection object

    To connect the ASP application to data source, we can use ADO.Connection
    object

    Const connectionString = "Provider=Microsoft.Jet.OLEDB.3.51; Data
    Source=C:\mydatabase.mdb;"
    Dim objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    ....
    objConn.Open connectionString
    objRS.Open sqlStatement, objConn '----------------- (1)


    The alternative is we can open the connection directly with ADO.RecordSet
    object, without using ADO.Connection object.

    objRS.Open sqlStatement, connectionString '---------------(2)


    What's the differences between line (1) and (2)? I read a book saying using
    Connection object is expensive, but I don't got it since there is connection
    anyway by using RecordSet object.

    Please advice. Thanks
    John


    John Davis 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