How do I connect to the Microsoft Access database using a DSN connection?

DSN connections require ODBC, an open standard for API for accessing databases. ODBC handles SQL requests and converts them into requests that the individual database systems understand. DSNs are also used by applications and Active Server Pages (ASP) to query databases and retrieve information.

Microsoft Access DSN connection strings

Without a password:

Code:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSNname"
%>

With a password:

Code:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSNname","username","password"
%>

Microsoft SQL Server DNS connection string:

Code:
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.open "DSN=MyDSN;UID=user;PWD=password;DATABASE=mydatabase"
%>