Which is faster: a connection for DSN or for OLE DB?
Printable View
Which is faster: a connection for DSN or for OLE DB?
I don't think you understand the difference between the two.
You can have an OLEDB connection using DSN or you can have DSNless connection. Here's an example:
Code:Dim cnDSN As New ADODB.Connection
Dim cnNoDSN As New ADODB.Connection
'Here's how you can open connection based on DSN
cnDSN.Open "Data Source=YourDSN;User ID=UserName;Password=UserPassword;"
'Here's how you can open Connection without DSN
cnNoDSN.Open "driver={SQL Server};" & _
"server=YourServerName;uid=UserId;pwd=Password;database=DatabaseName"
IF you're trying to ask which is faster ODBC or OLEDB, the answer is depends.
For SQL Server, OLEDB is faster. Other Architectures may not have OLEDB or may not work the same.