How do I connect to MySQL with ASP?

This applies to Windows Hosting accounts only.

You will need to use a DSNless connection which can be achieved by using code with the following VBscript:

set rsEvents = Server.CreateObject("ADODB.Recordset")
rsEvents.ActiveConnection = "Driver={MySQL ODBC 5.1 Driver}; DATABASE=databasename;USER=username; PASSWORD=password; Server=127.0.0.1"

...or the following JScript:

var rsEvents = Server.CreateObject("ADODB.Recordset");
rsEvents.ActiveConnection = "Driver={MySQL ODBC 5.1 Driver}; DATABASE=databasename;USER=username; PASSWORD=password; Server=127.0.0.1";

  • 343 Users Found This Useful
Was this answer helpful?

Related Articles

How do I set permissions on files and scripts?

Doing a CHMOD (changing a file's permissions) is the setting of access privileges for a file....

Do you support ASP.NET?

Yes, we do. ASP.NET and .NET2 applications will only run in a Windows hosting environment, and we...

Powered by WHMCompleteSolution