Hey there,
I'm currently working on a site which involves collection from two tables in an Access database on one page which I've never done before. However, I thought I'd got it working before a "error 800a0cc1" stopped me in my tracks.
I've checked the database to make sure all the field names are there and are named and spelled correctly according to the ASP code, and also the correct formats have been applied to the fields themselves. But, now I'm stuck. Below is the ASP code which I've pulled out of the page.
Code:
<%
var rsTestimonial = Server.CreateObject("ADODB.Recordset");
rsTestimonial.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("update/psychobeing.mdb")
rsTestimonial.Source = "SELECT TOP 1 testimonial, clientName FROM tbTestimonial ORDER BY Rnd(-10000000*TimeValue(Now())*[testimonialID])";
rsTestimonial.CursorType = 1;
rsTestimonial.CursorLocation = 2;
rsTestimonial.LockType = 1;
rsTestimonial.Open();
%>
<%
var rsDiary = Server.CreateObject("ADODB.Recordset");
rsDiary.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("update/psychobeing.mdb")
rsDiary.Source = "SELECT TOP 3 diaryID FROM tbDiary ORDER BY diaryID desc";
rsDiary.CursorType = 1;
rsDiary.CursorLocation = 2;
rsDiary.LockType = 1;
rsDiary.Open();
%>
<div id="diary"><%if (rsDiary.RecordCount == 0){%>
</p>
<p align="center">There are currently no diary entries. Please check back soon. </p>
<%}else{%>
<%while(!rsDiary.EOF){%>
<%=rsDiary("diaryDate")%> - <%=rsDiary("diaryTitle")%><br />
<%=rsDiary("diaryPost")%><br />
<a href="diary.asp" target="_parent">[read more]</a><br /><%rsDiary.MoveNext()}%>
<%}%></div>
<div id="testimonials"><%if (rsTestimonial.RecordCount == 0){%>
</p>
<p align="center">There are currently no Testimonials. Please check back soon. </p>
<%}else{%>
<%while(!rsTestimonial.EOF){%>
<%=rsTestimonial("testimonial")%><br />
<strong><%=rsTestimonial("clientName")%></strong><br /><br />
<a href="testimonials.asp" target="_parent">[read more]</a><br /><%rsTestimonial.MoveNext()}%>
<%}%></div>