Connect to a mysql database using a dsn connection via asp

Problem:

Connect to a mysql database using a dsn connection via asp



Solution:

* If you have defined the DSN on the Web Server, then the connection string is simply:

<%
 
Dim conn
set conn=Server.CreateObject(ADODB.Connection)
conn.ConnectionString = "DSN=<your DSN>"
conn.open
 
%>

>>where you replace <Your DSN> with the name of the DSN that you created to point to the database.<<
 
Note:To use the above connection string you make sure that you have to create a DSN for the database.
 
Tip *:To create DSN for the MySql database,please refer "how we can setup a system DSN to access our MySQL database through ASP" article in this section.*

 

  • 0 Els usuaris han Trobat Això Útil
Ha estat útil la resposta?

Articles Relacionats

Which port should I use, 80 or 3306 ?

Problem: Which port should I use, 80 or 3306 ? Solution: You should ALWAYS use port 3306,...

Connect to a mysql database using a dsn-less connection via asp

Problem: Connect to a mysql database using a dsn-less connection via asp Solution:...

ERROR 2008: MySQL client ran out of memory

Problem: ERROR 2008: MySQL client ran out of memory Solution: Problem:   If you issue...

how we can setup a system DSN to access our MySQL database through ASP

Problem: how we can setup a system DSN to access our MySQL database through ASP Solution:...

How to Export and then Import a MySQL database using PhpMyADMIN

Problem: How to Export and then Import a MySQL database using PhpMyADMIN Solution: The...