title: MS access Database Connection using ASP
body: <p>I am using ASP for the first time.  I have connected to a database access using ASP but I cannot fetch the data from my MS Access Database. I don't even know whether I'm connected to my Database. I guess I'm doing it wrong.</p>
  
  <p>I'm using the following code</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;%
      set conn=Server.CreateObject("ADODB.Connection")
      conn.Provider="Microsoft.Jet.OLEDB.4.0"
      conn.Open "C:\Amit Chadwick\IPTC\Database\IPTC.mdb"
  
      set rs = Server.CreateObject("ADODB.recordset")
      rs.Open "Select * from Image_Data", conn%&gt;
      &lt;table border="1" width="100%"&gt;
      &lt;%do until rs.EOF%&gt;
      &lt;tr&gt;    
      &lt;%for each x in rs.Fields%&gt;
      &lt;td&gt;&lt;%Response.Write(x.value)%&gt;&lt;/td&gt;
      &lt;%next
      rs.MoveNext%&gt;
      &lt;/tr&gt;
      &lt;%loop
      rs.close
      conn.close
  %&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>