title: Classic ASP adding records to MySQL
body: <p>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. </p>
  
  <p>I have attached below the script I used with the old host which now errors</p>
  
  <blockquote>
    <p>Data source name not found and no default driver specified</p>
  </blockquote>
  
  <p>After a bit of digging it seems I have to change the driver to <code>{MySQL ODBC 5.3 Unicode Driver}</code> but it still errors. It seems to point to the cursor/lock type but I have used all option with no success.</p>
  
  <blockquote>
    <p>ODBC driver does not support the requested properties.</p>
  </blockquote>
  
  <pre class="lang-vb prettyprint-override"><code>&lt;%
  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
  %&gt;
  </code></pre>