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. Otis Mukinfus
    Replies:
    3
    Views:
    987
    Juan T. Llibre
    Jul 8, 2005
  2. Replies:
    3
    Views:
    40,855
    Roedy Green
    Nov 16, 2005
  3. Author Tarun Tyagi
    Replies:
    0
    Views:
    781
    Author Tarun Tyagi
    Dec 29, 2004
  4. Orit
    Replies:
    2
    Views:
    729
  5. Allan Ebdrup
    Replies:
    2
    Views:
    529
    Allan Ebdrup
    Oct 6, 2006
Loading...

Share This Page