I have had to move on of my old classic ASP projects to a new host, and I'm having problems connecting to their MySQL server.
I have attached below the script I used with the old host which now errors
Data source name not found and no default driver specified
After a bit of digging it seems I have to change the driver to {MySQL ODBC 5.3 Unicode Driver} but it still errors. It seems to point to the cursor/lock type but I have used all option with no success.
ODBC driver does not support the requested properties.
<%
Dim Conn
Dim Rs
Dim sql
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Conn.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=xxx; PORT=xxx; DATABASE=xxx; UID=xxx; PASSWORD=xxx; OPTION=3"
sql= "SELECT * FROM table;"
Rs.CursorType = 2
Rs.LockType = 3
Rs.Open sql, Conn
Rs.AddNew
Rs.Fields("database") = Request.Form("form")
Rs.Update
Rs.Close
Set Rs = Nothing
Set Conn = Nothing
%>
AddNew()? Just execute a SQLINSERTstatement, its simpler and less error prone.Data source name not found and no default driver specifiedbefore you changed it?SELECTthen have the ADODB.Update()to do theINSERTwhich is two db calls instead of one maybe simple but inefficient.