<%@ Page aspcompat=true Debug="true"%> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.ODBC" %> <% Dim title, author, ArticleID title = Request("title") author = Request("author") ArticleID = Request("Article") 'sqlstr="Select TblArticle.*,TblMentor.ID as MentorId,TblMentor.Fname,TblMentor.Lname,TblMentor.Title as theTitle,TblMentor.image as mentorimage,TblCategory.Name AS ArtName,TblCategory.ID as CatID From TblArticle,TblMentor,TblCategory Where (TblArticle.MentorID=TblMentor.ID OR TblArticle.MentorID2=TblMentor.ID) AND TblArticle.CategoryID=TblCategory.ID AND TblArticle.ID="&ArticleID sqlstr="Select TblArticle.ID,TblArticle.Name,TblArticle.MentorID,TblArticle.MentorID2,TblArticle.File as thefile,TblArticle.DateAdded,TblArticle.CategoryID,TblArticle.Image as ArticleImage,TblArticle.PubMonth,TblMentor.ID as MentorId,TblMentor.Fname,TblMentor.Lname,TblMentor.Title as theTitle,TblMentor.image as mentorimage,TblCategory.Name AS ArtName,TblCategory.ID as CatID From TblArticle,TblMentor,TblCategory Where (TblArticle.MentorID=TblMentor.ID OR TblArticle.MentorID2=TblMentor.ID) AND TblArticle.CategoryID=TblCategory.ID AND TblArticle.ID='" & ArticleID & "'" rs = objConn.execute(sqlstr) rs.MoveFirst Dim theTitle = (rs("theTitle").value) Dim Fname = (Server.HtmlEncode(rs("Fname").value)) Dim Lname = (Server.HtmlEncode(rs("Lname").value )) Dim ArtName = (Server.HtmlEncode(rs("ArtName").value )) 'Dim thename = (Server.HtmlEncode(rs("name").value )) Dim thename = (rs("name").value) Dim CatId = (Server.HtmlEncode(rs("CatId").value )) Dim MentorId = (Server.HtmlEncode(rs("MentorId").value )) Dim MentorID2 = (rs("MentorID2").value) ' we need to create code to test for null or not on MentorID2. If its not null, we can do normal declaration. If its null then we dance a bit If (MentorID2.Equals(System.DBNull.Value)) Then 'anything to do here? I dont think so Else MentorID2 = (Server.HtmlEncode(rs("MentorId2").value )) End IF 'Response.Write (thename) Dim thenamemeta as string thenamemeta = thename Dim RegExStr As String = “<[^>]*>” Dim R As New Regex(RegExStr) thenamemeta = R.Replace(thenamemeta, ” “) Dim catno catno = CatId 'Response.Write ("
" & thenamemeta & "
") '* '***** CHECK FOR NULL SECOND AUTHOR '* Dim Men2 = "Not Null" If ((rs("MentorID2").value).Equals(System.DBNull.Value)) Then Men2 = ("Null") Else Men2 = ("Not Null") End If 'Response.Write ("Men2 is " & Men2) '* '***** CHECK FOR NULL ARTICLE IMAGE '* Dim ArtImage = (rs("ArticleImage").value) Dim AImg = "Not Null" If (ArtImage.Equals(System.DBNull.Value)) Then AImg = ("Null") else AImg = ("Not Null") end if 'Response.Write ("
Article image is " & AImg) '* '***** CHECK FOR NULL MENTOR IMAGE '* Dim mentorimage = (rs("mentorimage").value ) Dim Img ="Not Null" If (mentorimage.Equals(System.DBNull.Value)) Then Img = ("Null") else Img = ("Not Null") end if 'Response.Write ("
Mentor Image is " & Img) Dim DisplayImage = "None" if AImg ="Not Null" then DisplayImage = (Server.HtmlEncode(rs("ArticleImage").value )) end if if AImg = "Null" and Img = "Not Null" then DisplayImage = (Server.HtmlEncode(rs("mentorimage").value )) end if 'Response.Write ("
Display image: " & DisplayImage) Dim PubMonth = (Server.HtmlEncode(rs("PubMonth").value )) Dim PMonthMo = (datepart("m",PubMonth)) if PMonthMo < 10 then PMonthMo = "0" & PMonthMo end if 'Response.Write ("
PubMonth month: " & PMonthMo) Dim PMonthYr = (DatePart("yyyy",PubMonth)) PMonthYr = (right(PMonthYr,2)) 'Response.Write ("
PubMonth year: " & PMonthYr) Dim PubDate = PMonthMo & "_" & PMonthYr 'Response.Write ("
Pub Date: " & PubDate) Dim thefile = (Server.HtmlEncode(rs("thefile").value )) %> <% Dim authorstr = Fname & " " & Lname 'Response.Write ("
authorstr: " & authorstr) 'Response.Write ("By: "& Fname &" "& Lname) If Men2 = "Not Null" Then'Test for Null dim objConn2, rs2, sqlstr2 objConn2 = Server.CreateObject("ADODB.Connection") ' Set removed. objConn2.Open ("DSN=swiftsuccess;UID=swiftsuccesscom;PWD=HWnW2003;DATABASE=swiftsuccess") sqlstr2="Select Title,Fname,Lname from TblMentor Where ID="& MentorID2 rs2 = objConn2.execute(sqlstr2) rs2.MoveFirst Dim Fname2 = (Server.HtmlEncode(rs2("Fname").value )) Dim Lname2 = (Server.HtmlEncode(rs2("Lname").value )) authorstr= authorstr & " and " & Fname2 & " " &Lname2 ' Response.Write (" and "& Fname2 &" "& Lname2) rs2.Close rs2=nothing objconn2.Close Objconn2=nothing End IF'end test for second author 'Response.Write ("
AuthorStr:" & authorstr & "
") %> <% = authorstr %> <% = ArtName %> Article <% dim robottag if author="" or title="" then robottag= "noindex" else robottag= "index,follow" end if %>

More Important Issues...

 
Work At Home FREE Course
 
The Missing Instructions
 
2012 Free Video
 
Passion Test Facilitator
 
Passion Test Profile