DB Connection- Best way?

Results 1 to 2 of 2

Thread: DB Connection- Best way?

  1. #1
    Join Date
    Dec 1969

    Default DB Connection- Best way?

    Hello,<BR><BR>I use two ways to connect to an Access database, but can someone tell me which method is the better, and why? :-)<BR><BR>the common code:<BR><BR>&#060;%<BR><BR>&#039;Open Database<BR>Dim DBpath, ConnStr<BR>DBPath=server.mappath("grafx.mdb")<BR>& #039;connStr HERE<BR>Set Conn=server.createobject("adodb.connection")<BR>co nn.open ConnStr<BR>%&#062;<BR><BR>1. Method 1: <BR><BR>ConnStr="DRIVER=Microsoft Access Driver (*.mdb); UID=admin; UserCommitSync=Yes; Threads=20; SafeTransactions=1; PageTimeout=5; MaxScanRows=8; MaxBufferSize=8192; FIL=MS Access;DriverId=281; DBQ=" & DBPath<BR><BR><BR>2. Method 2.<BR><BR>ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBPath<BR><BR><BR>Thanks,<BR><BR>Mark

  2. #2
    Join Date
    Dec 1969

    Default RE: DB Connection- Best way?

    The OLEDB drivers ("method 2") are generally considered to be better because they provide better error messages and are apparently slightly faster than the ODBC drivers ("method 1").<BR><BR>I&#039;ve also had locking issues when using the ODBC driver which have been sorted as soon as I&#039;ve moved to the OLEDB driver.<BR><BR>So in my opinion, the OLEDB drivers are the best.<BR><BR>Craig.

Posting Permissions

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