Henter ikke data fra DB
Mit script viser ikke data fra db, hvorfor?Script:
<%
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/nyhedsmail/mail/kundekartotek.mdb")
Set objRs = Conn.Execute("Select Top 1 Teksten From NyhedsTekster Where NyhedsType = '' Order By ID DESC")
If Not objRs.Eof Then
strIndhold = objRs("Teksten")
strIndhold = Server.HTMLencode(strIndhold)
strindhold = Replace(strIndhold, vbcrlf, "<br>")
strindhold = Replace(strIndhold, "", "<b>")
strindhold = Replace(strIndhold, "", "</b>")
strindhold = Replace(strIndhold, "[k]", "<i>")
strindhold = Replace(strIndhold, "[/k]", "</i>")
strindhold = Replace(strIndhold, "", "<u>")
strindhold = Replace(strIndhold, "", "</u>")
strindhold = Replace(strIndhold, "", "<u>")
strindhold = Replace(strIndhold, "", "</u>")
strindhold = Replace(strIndhold, "[9pt]", "<font style=""font-size: 9pt;"">")
strindhold = Replace(strIndhold, "[11pt]", "<font style=""font-size: 11pt;"">")
strindhold = Replace(strIndhold, "[13pt]", "<font style=""font-size: 13pt;"">")
strindhold = Replace(strIndhold, "[/pt]", "</font>")
strindhold = Replace(strIndhold, "[linie]", "<hr noshade>")
strindhold = autoHighlight(strIndhold)
strindhold = Replace(Replace(strindhold,"'","''"),""","""")
End If
objRs.Close
Set objRs = Nothing
conn.Close
Set conn = Nothing
strURL = "http://www.xxx.dk/nyhedsmail/mail"
strBody = "<!DOCTYPE html PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN""><html><head><meta http-equiv=""content-type"" content=""text/html;charset=iso-8859-1""><title>Nyhedsbrev</title><style type=""text/css"">"
strBody = strBody & "body {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;color: #999999;text-decoration: none;}"
strBody = strBody & "td {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;color: #999999;text-decoration: none;}"
strBody = strBody & "a:link {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;color: #CC6699;text-decoration: underline;}"
strBody = strBody & "a:visited {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;color: #CC6699;text-decoration: none;}"
strBody = strBody & "a:hover {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;color: #666666;text-decoration: none;}"
strBody = strBody & "a:active {font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;color: #CC6699;text-decoration: none;}"
strBody = strBody & ".bold{font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 10px;font-weight: bold;color: #999999;text-decoration: none;}"
strBody = strBody & ".adr{font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 9px;font-weight: normal;color: #CC6699;text-decoration: none;}"
strBody = strBody & "</style></head><body bgcolor=""#FFFFFF""><table align=""center"" border=""0"" width=""600"" cellspacing=""0"" cellpadding=""0""><tr>"
strBody = strBody & "<td width=""100%"" colspan=""4""><img border=""0"" src=""" & strURL & "/email.5.gif"" width=""213"" height=""77""></td>"
strBody = strBody & "</tr><tr><td width=""100%"" bgcolor=""#FCDDEA"" colspan=""4""><img border=""0"" src=""" & strURL & "/spacer.gif"" width=""2"" height=""27""></td>"
strBody = strBody & "</tr><tr><td bgcolor=""#FCDDEA""><img border=""0"" src=""" & strURL & "/line.gif"" width=""2"" height=""188"">"
strBody = strBody & "</td><td width=""30"" valign=""top""><table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr>"
strBody = strBody & "<td><table border=""0"" cellspacing=""0"" cellpadding=""0""><tr><td><img border=""0"" src=""" & strURL & "/new_rose.jpg"" width=""210"" height=""343"" hspace=""10"" vspace=""10""></td>"
strBody = strBody & "</tr></table></td></tr></table></td><td width=""70%"" align=""center""><table border=""0"" cellspacing=""0"" cellpadding=""0""><tr><td align=""center"">"
strBody = strBody & "<p align=""center""><img border=""0"" src=""" & strURL & "/email.3.gif"" width=""310"" height=""36""></td></tr><tr>"
strBody = strBody & "<td align=""center"" style=""padding: 0px 5px 0px 0x;""> " & strIndhold & " "
strBody = strBody & "<br><br>Med venlig hilsen<br>FR & LY<br><br></td></tr></table></td><td bgcolor=""#FCDDEA""><img border=""0"" src=""" & strURL & "/line.gif"" width=""2"" height=""188""></td>"
strBody = strBody & "</tr><tr><td bgcolor=""#FCDDEA"" colspan=""4"" valign=""middle"" align=""center"" height=""20""><p align=""center"" class=""adr"">FR"
strBody = strBody & " & LY vej 1 <a href=""http://www.xxx.dk"">http://www.xxxx.dk</a></p></td>"
strBody = strBody & "</tr></table></body></html>"
%>
Og i selve documentet skulle den vise indholdet her:
<div><%= strBody %></div>
