troubleshooting Question

when changing update statement syntax/ receiving errors.

Avatar of itortu
itortuFlag for United States of America asked on
Web Languages and Standards
13 Comments2 Solutions181 ViewsLast Modified:

i'm trying to change the update statement:

conn.Execute("UPDATE tblServiceStandards SET Action_Taken = Action_Taken + '" & vbCrLf & dateCompleted & "' + ' " & Action_Taken & "' WHERE ticketnumber = " & ticketnumber & ";")

to this form:

Sub saveVariables

opencon
sql = "SELECT * FROM tblServiceStandards WHERE ticketnumber =" & ticketnumber
set RS = Server.CreateObject("ADODB.Recordset")
RS.Open sql, connectme, 1, 3

if rs.bof = true and rs.eof = true then
    response.write ("Record not found!")
else
    do until rs.eof = true
    if IsDate(dateCompleted) then
        Rs.Fields("fldDate") = sfldDate
        Rs.Fields("Reported_By").value = sReported_By
        Rs.Fields("Severity").value = sSeverity
        Rs.Fields("Duration").value = sDuration
        Rs.Fields("Status").value = sStatus
        Rs.Fields("ServicesAffectedID").value = sServicesAffectedID
        Rs.Fields("Problem_Description").value = sProblem_Description
        Rs.Fields("Assigned_To").value = sAssigned_To
        Rs.Fields("Action_Taken").value = "Action_Taken + '" & vbcrlf & dateCompleted & " ' + ' "  &  sAction_Taken  &  " ' "
        rs.UpdateBatch adAffectAll
    exit do
    end if
    rs.movenext
    Loop
end if
closecon
End Sub

and when i submit the page, i get an error that says: "The function expects a string as input"  line 213
Rs.Fields("Action_Taken").value = "Action_Taken + '" & vbcrlf & dateCompleted & " ' + ' "  &  sAction_Taken  &  " ' "     << line 213

i am would like to insert/append into the field Äction_Taken the values dateCompleted, and sAction_Taken which is appended to whatever contents are already on the field.

can i be advise on how do i need to change this line, so all these values are inserted? thanks for all you help. it is very much appreciated. please tell me if increasing the poin value is neccesary.

regards.

itortu.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 13 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros