MySQL Connection Strings for Classic ASP

Last updated: August 26, 2026.

ADO can connect to MySQL through Connector/ODBC using a system DSN or a DSN-less connection string. A system DSN is usually simpler to maintain on IIS.

System DSN

<%
Dim connection
Set connection = Server.CreateObject("ADODB.Connection")
connection.Open "DSN=AppMySQL;UID=app_user;PWD=use-a-secret-store;"
%>

DSN-less template

<%
Dim connectionString
connectionString = "Driver={YOUR INSTALLED MYSQL ODBC UNICODE DRIVER};" & _
                   "Server=127.0.0.1;Database=appdb;" & _
                   "User=app_user;Password=use-a-secret-store;Option=3;"
%>

Use the exact driver name shown in ODBC Data Sources. Match the IIS application-pool architecture, require encrypted transport when the database is remote, and never commit credentials to a public script.

admin

admin

Leave a Reply

Your email address will not be published.