Click to See Complete Forum and Search --> : Problem connecting to MySQL Database


kajol75
March 15th, 2005, 12:38 AM
Hi everyone

I am trying to connect to a MySQL database from a ".aspx" page, but getting error "Data source name not found and no default driver specified ".

I am writing the code as follows...


Dim con As Odbc.OdbcConnection = New Odbc.OdbcConnection
con.ConnectionString = "STMT=;OPTION=;UID=test;PASSWORD=;DRIVER=MySQL ODBC 3.51 Driver;DESC=; DATABASE=Test_Database;SERVER=IP Address;PORT=3306"
con.Open()

But, If I am writing the same code in a VB.NET windows application, then the code is working fine.
Can anybody tell me, what is the problem in my ASP.NET application, that is giving the error above mentioned.

Thanks in advance

Kajol

hspc
March 17th, 2005, 03:19 AM
Did you try both the ASPx and the windows applicaiton on the same machine ?
generally, I have ASPx pages work fine with MySQL
also check : http://www.connectionstrings.com