title: Change ASP .mdb access to DSN Less Connection?
body: <p>I have an old ASP site (written a long time ago by a former employee) that connects to a 2003 ODBC database using DSN. The servers have been updated by our hosts to 2008, and we can no longer use ODBC so I have to make the connections DSN-Less. </p>
  
  <p>Unfortunately I have very little knowledge of ASP, and database connections through ASP. I wonder if anybody can help me change the code to connect to the Access database without ODBC?</p>
  
  <p>I think it connects using this code:</p>
  
  <pre class="lang-vbs prettyprint-override"><code>&lt;%
  ' Get current name of region and intro text
  Dim objRec, sql, introtext
  sql="SELECT * FROM hometext WHERE home_id = 1"
  set objRec=Server.CreateObject("ADODB.Recordset")
  objRec.Open sql, "dsn=databasename"
  introtext = Replace(objRec("home_introtext"), vbCrLf, "&lt;br /&gt;")
  
  ' Get the 5 newest news items
  Dim objRec2, sql2, newstext
  sql2="SELECT TOP 5 news_date, news_text FROM news ORDER BY news_date DESC"
  set objRec2=Server.CreateObject("ADODB.Recordset")
  objRec2.Open sql2, "dsn=databasename"
  
  ' Get all images to appear to page
  Dim objRec3, sql3
  sql3="SELECT * FROM homeimages ORDER BY homeimage_date DESC"
  set objRec3=Server.CreateObject("ADODB.Recordset")
  objRec3.Open sql3, "dsn=databasename"
  
  ' Get the next 5 events from the current date
  Dim objRec4, sql4
  sql4="SELECT TOP 5 event_date, event_name FROM events WHERE event_date &gt;= " &amp;         niceDateAccess(Date()) &amp; " ORDER BY event_date"
  set objRec4=Server.CreateObject("ADODB.Recordset")
  objRec4.Open sql4, "dsn=databasename"
  %&gt;
  </code></pre>
  
  <p>I'm not sure how it all connects, I'm not much of a scripter.</p>
  
  <p>Any (dumbed down) help would be appreciated!</p>
  
  <p>Thanks</p>
  
  <p>EDIT: The database is sat in the 'private' folder in the root folder on the server.</p>