Q

Connecting to ASP pages with or without DSN

MySQL expert Scott Noyes explains how to connect MySQL to ASP pages with or without DSN.

How does MySQL compare to Access 2000 and SQL Server as a back end for ASP pages? Does it run as a file like Access does, or as a service like SQL Server?

You can connect ASP pages to MySQL using ODBC. Download the ODBC drivers. Once you have MyODBC configured, you can connect to MySQL with or without DSN.

Using DSN:
<%
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=mysql_dsn"
%>

Without DSN:
<%
set conn = createobject("ADODB.Connection") conn.open = "DRIVER={MySQL ODBC 3.51 Driver};" & _
 "SERVER=yourHostName;" & _
 "DATABASE=yourDBName;" & _
 "UID=yourUserName;PWD=yourPassword; OPTION=35;"
%>
Check for values for the OPTION parameter.
This was last published in September 2006

Dig Deeper on Open source databases

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

SearchServerVirtualization

SearchCloudComputing

SearchEnterpriseDesktop

Close