DSN, DSN-less and Recordset

Results 1 to 2 of 2

Thread: DSN, DSN-less and Recordset

  1. #1
    Join Date
    Dec 1969

    Default DSN, DSN-less and Recordset

    Hello! I am new to ASP. I have two questions.<BR><BR>1.I can use either one of the following two codes to open a MS Access database. My question is : what are the differences?<BR><BR>(I)<BR>Set Conn=Server.CreateObject("ADODB.Connection")<BR>Co nn.Open "db"<BR><BR>(II)<BR>Set Conn=Server.CreateObject("ADODB.Connection")<BR>Co nn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db.mdb") & ";UID=sa;PWD="<BR><BR>2.After connecting to the database by either (I) or(II), I can use SQL to manage the database. My question is : why do I use Recordset ?<BR><BR>Thank you for your attention !

  2. #2
    Join Date
    Dec 1969

    Default RE: DSN, DSN-less and Recordset

    All the performance tests that I&#039ve seen indicate that using a DSN-less connection is faster than using a DSN (I guess there&#039s at least one extra layer of processing to resolve the DSN). I notice that you&#039re using an old-style ODBC connection string - you&#039ll get better performance if you use OLE DB connection string like "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="... provided you&#039ve got the right OLE DB data provider.<BR><BR>You use recordsets whenever you run a query that returns records from the database - even if you use Connection.Execute(), the result is returned as a recordset. The usual reason to create a recordset explicitly is so that you can set its properties (cursor type, lock type, cache size etc) before you populate it.<BR><BR>Dunc

Posting Permissions

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