Home » Categories » Multiple Categories

How do I connect to MySQL with ASP?

To connect to a MySQL database through ASP on your Windows hosting account:

You will need to use a DNSless connection, which you can achieve with the following VBScript:

set rsEvents = Server.CreateObject("ADODB.Recordset")

rsEvents.ActiveConnection = "Driver={MySQL ODBC 5.1 Driver}; DATABASE=[DATABASE NAME];USER=[USER NAME]; PASSWORD=[PASSWORD]; Server=[SERVER IP ADDRESS]"

Or the following JScript:

var rsEvents = Server.CreateObject("ADODB.Recordset");

rsEvents.ActiveConnection = "Driver={MySQL ODBC 5.1 Driver}; DATABASE=[DATABASE NAME];USER=[USER NAME]; PASSWORD=[PASSWORD]; Server=[SERVER IP ADDRESS]";

Replace [DATABASE NAME] with the name of your database.

Replace [USER NAME] with your user name.

Replace [PASSWORD] with your password.

Replace [SERVER IP ADDRESS] with your server’s IP address or name (which you can find in your eXtend control panel).

1 (2)
Article Rating (2 Votes)
Rate this article
  • Icon PDFExport to PDF
Related Articles
How do I connect to my MySQL database using PHP?
Added on Thu, Feb 26, 2015
Are ionCube and Zend Guard Loader installed on your servers?
Added on Mon, Mar 16, 2015
What is MySQL and what does it do?
Added on Thu, Feb 26, 2015
Do you support Zend Optimizer?
Added on Wed, Apr 8, 2015
How do I connect to my MySQL database from my Perl script?
Added on Thu, Feb 26, 2015