connect to the data source with or without Connection object

Discussion in 'ASP General' started by John Davis, Aug 28, 2003.

  1. John Davis

    John Davis Guest

    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, Aug 28, 2003
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?S2h1emVtYQ==?=

    Object Data Source and Custom Business Object

    =?Utf-8?B?S2h1emVtYQ==?=, Jun 27, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    888
    =?Utf-8?B?S2h1emVtYQ==?=
    Jun 27, 2005
  2. Otis Mukinfus
    Replies:
    3
    Views:
    1,204
    Juan T. Llibre
    Jul 8, 2005
  3. Replies:
    3
    Views:
    42,130
    Roedy Green
    Nov 16, 2005
  4. Siva
    Replies:
    1
    Views:
    1,444
    Jeff Dillon
    Apr 24, 2006
  5. Author Tarun Tyagi
    Replies:
    0
    Views:
    957
    Author Tarun Tyagi
    Dec 29, 2004
  6. Orit
    Replies:
    2
    Views:
    834
  7. Allan Ebdrup
    Replies:
    2
    Views:
    646
    Allan Ebdrup
    Oct 6, 2006
  8. Replies:
    2
    Views:
    586
Loading...