Hi people....any one tell me whats wrong....I am connecting to an SQL
database (I am *** for passwords etc) and i am getting this message
everytime i try to access the records from the database.... I am NOT
WRITING or UPDATING the database, just reciveing records.... I am getting
an error message on line 54, which is pulling the NOTES information from
the field... heres the code:
<%
Dim oConn
Dim oRS
Dim Sqltxt
Set oConn = Server.CreateObject("ADODB.Connection")
Set oRS = Server.CreateObject("ADODB.Recordset")
Dim FSO,oFile
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
If NOT FSO.FileExists(Server.MapPath("log.txt") ) Then
Set oFile = FSO.CreateTextFile(Server.MapPath("./log.txt") )
Else
Set oFile = FSO.OpenTextFile(Server.MapPath("./log.txt") ,8)
End If
oFile.Write Date() & VbCrLf
SQLtxt = "SELECT Calls.Callid, Calls.ContactID,
Calls.Forename, CallsHistory.Action, Calls.Surname, Calls.Email,
CallsHistory.Notes, Calls.DateClosed "
SQLtxt = SQLtxt & " FROM Calls INNER JOIN CallsHistory ON
Calls.Callid = CallsHistory.FKey "
SQLtxt = SQLtxt & " WHERE (((CallsHistory.Action)=4))
ORDER BY Calls.CallID;"
oRS.Open SQLtxt,"DSN=****;UID=***;PWD=***"
While Not oRS.EOF
If Instr(oRS("DateClosed"),Date()-1) Then
ofile.WriteLine "CallID :" & oRS("CallID")
ofile.WriteLine "Forename :" & oRS("Forename")
ofile.WriteLine "Surname :" & oRS("Surname")& VbCrLf
Set objMail = Server.CreateObject("CDONTS.NewMail")
HTML = "<HTML>"
HTML = HTML & "<HEAD>"
HTML = HTML & "<table width=100% border=0
cellspacing=2 cellpadding=2>"
HTML = HTML & "<tr><td width=20%
valign=top><font face=Arial, Helvetica, sans-serif><b>Reference
Call:</B></font></td>"
HTML = HTML & "<hr>"
HTML = HTML & "<td width=80%
valign=top><font face=Arial, Helvetica, sans-serif><b>" & oRS("CallID")
& "</b></font></td>"
HTML = HTML & "</table>"
HTML = HTML & "<hr>"
HTML = HTML & "<table width=100% border=0
cellspacing=2 cellpadding=2>"
HTML = HTML & "<tr><td width=20%
valign=top><font face=Arial, Helvetica, sans-serif><i><b>Dear </i>" &
oRS("Forename") & "...</b></font><br></td>"
HTML = HTML & "<td width=80%
valign=top><font face=Arial, Helvetica, sans-serif>Your call has now been
dealt with and solved.</font></td></tr>"
HTML = HTML & "</table>"
HTML = HTML & "<table width=100% border=0
cellspacing=2 cellpadding=2>"
HTML = HTML & "<tr><td width=20%
valign=top><font face=Arial, Helvetica, sans-serif><b>Action
Taken:</B></font></td>"
'HTML = HTML & "<td width=80%
valign=top><font face=Arial, Helvetica, sans-serif>" & Replace(oRS
("Notes"),VbCrLf,"<br>")& "<br><br></font></td></tr>"
HTML = HTML & "<td width=80%
valign=top><font face=Arial, Helvetica, sans-serif>" & oRS("Notes") = Trim
(Cstr(Notes)) & "<br><br></font></td></tr>"
HTML = HTML & "</table>"
HTML = HTML & "<table width=100% border=0
cellspacing=2 cellpadding=2>"
HTML = HTML & "<tr><td width=65%
valign=top><font face=Arial, Helvetica, sans-serif>If you have any further
problems, please contact the IT Helpdesk.<br><br></font></td></tr>"
HTML = HTML & "<tr><td width=15%
valign=top><font face=Arial, Helvetica, sans-
serif><b>Regards,</B></font><br></td></tr>"
HTML = HTML & "<tr><td width=20%
valign=top><font face=Arial, Helvetica, sans-serif>IT
Helpdesk</font></td></tr>"
HTML = HTML & "</table>"
HTML = HTML & "</BODY>"
HTML = HTML & "</HTML>"
objMail.From = "ITHelpdesk"
objMail.Subject = "IT Helpdesk Call Now
Closed"
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.To = oRS("Email")
objMail.Body = HTML
objMail.Send
Set objMail = Nothing
response.write "<b><font face=Arial,
Helvetica, sans-serif>User informed:</b> " & ors("ForeName") & " " & oRs
("Surname") & "<br></font> "
End if
oRS.Movenext
Wend
oFile.Close
Set FSO = nothing
Set oRS = nothing
Set oConn = nothing
%>
Thanks for help....
Dale