Jump to content

Connecting to MySQL from classic ASP


wilsonf1

Recommended Posts

I've been using Access tables for my sites for years but want to connect to a proper MySQL database, here is how I have been connecting:

oDatabase.OpenODBC("cms_websites")oDatabase.SQL = "SELECT * FROM system_websites WHERE folder = '" & qsWebsite & "' "oDatabase.Execute oDatabase.SQLoRecordset.Open oDatabase.SQL, oDatabase.Connection, oDatabase.CursorLocation, 1

Now here is the connection string given to me by my host, how do i bolt this into my ASP - does much need changing?

"driver={MySQL ODBC 3.51 Driver};option=16387;server=localhost:8888;user=;password=;DATABASE=jwilson-db1;"

Link to comment
Share on other sites

  • 4 weeks later...

ive made progress but have the error:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specifiedany ideas? this is all on my local machine

		Dim oDBConnection		Dim oDBRecordset				Set oDBConnection = Server.CreateObject("ADODB.Connection")		Set oDBRecordset = Server.CreateObject("ADODB.Recordset")		Dim sConnectionString		sConnectionString = "driver={MySQL ODBC 3.51 Driver};option=16387;server=127.0.0.1;user=jwilson;password=xxxxxx;DATABASE=jwilson-db1;"		[b]oDBConnection.Open sConnectionString[/b]				oDatabase.SQL = "SELECT * FROM system_websites WHERE folder = '" & qsWebsite & "' "		oDatabase.Execute oDatabase.SQL				oDBRecordset.Open oDatabase.SQL, oDBConnection

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...