<% Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("db/content.mdb") & ";" objConn.Open Set rsPage = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM tblPages WHERE PageID=" & Request.Querystring("pid") rsPage.Open strSQL, objConn If Not rsPage.EOF Then If rsPage("PageHeadline")<>"" Then Response.Write("

" & rsPage("PageHeadline") & "

") End If Set rsParagraphs = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM tblParagraphs WHERE PgPageID=" & rsPage("PageID") & " AND PgPublished=1 ORDER BY PgSortOrder,PgID" rsParagraphs.Open strSQL, objConn Do While Not rsParagraphs.EOF Response.Write("

" & Replace(rsParagraphs("PgHeadline"),vbCrLf,"
") & "

") If rsParagraphs("PgImage")>0 Then Set rsImage = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM tblImages WHERE ImageID=" & rsParagraphs("PgImage") rsImage.Open strSQL, objConn ImagePath=rsImage("ImagePath") rsImage.Close Set rsImage = Nothing End If If rsParagraphs("PgImageLink")<>"" Then Response.Write("") End If If ImagePath<>"" And rsParagraphs("PgImageAlign")=0 Then Response.Write("

") End If If ImagePath<>"" And rsParagraphs("PgImageAlign")=2 Then Response.Write("

") End If If ImagePath<>"" And rsParagraphs("PgImageAlign")=3 Then Response.Write("

") End If If rsParagraphs("PgImageLink")<>"" Then Response.Write("
") End If Response.Write("

" & Replace(rsParagraphs("PgText"),vbCrLf,"
") & "


") If rsParagraphs("PgLink")<>"" Then Response.Write("

" & rsParagraphs("PgLinkText") & " ") End If If rsParagraphs("PgDoc")>0 Then Set rsDoc = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT * FROM tblDocs WHERE DocID=" & rsParagraphs("PgDoc") rsDoc.Open strSQL, objConn DocPath=rsDoc("DocPath") rsDoc.Close Set rsDoc = Nothing Response.Write("

") Response.Write(rsParagraphs("PgDocText") & " ") End If If rsParagraphs("PgImageLink")<>"" Then Response.Write("") End If If ImagePath<>"" And rsParagraphs("PgImageAlign")=1 Then Response.Write("

") End If If rsParagraphs("PgImageLink")<>"" Then Response.Write("
") End If rsParagraphs.MoveNext Loop rsParagraphs.Close Set rsParagraphs = Nothing End If rsPage.Close Set rsPage = Nothing objConn.Close Set objConn = Nothing %>