You are here:

Knowledgebase

Did you know that we are one of the cheapest domain registrars in the UK Find out more...

Portal Home > Knowledgebase > Databases > How do I connect to Mysql with ASP


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";

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Language:

Testimonials

Fantastic support from polite staff - 10 stars!