I am using a recordset to retrieve values from a sql server database that I would want to display on an classic ASP page. It however seems that I cannot get a string value from the recordset. It just shows a blank space on the page that I want that value to appear. I have marked as bold the value that is supposed to have a string value in the code below. Please help me out and let me know what I could be missing. I am working with VBScript.
Code:
Dim objNotesConn Dim objNotesCommand Dim objNotesRecordset dim intNoteUserID dim intNoteModByUserID dim intNotesID dim strObjCityCareNote dim datNoteDateCreated dim datNoteDateModified ' Create the connection objNotesRecordset. Set objNotesConn = Server.Createobject("ADODB.Connection") objNotesConn.Open Application("ConnStr") ' Execute pe_selectCityCareNotes1. Set objNotesCommand = Server.Createobject("ADODB.Command") objNotesCommand.ActiveConnection = objNotesConn objNotesCommand.CommandType = adcmdStoredProc objNotesCommand.CommandText = "pe_selectCityCareNotes1" objNotesCommand.Parameters.append objCommand.createParameter("intPersonID", adInteger, adParamInput) objNotesCommand.Parameters("intPersonID") = intPersonID Set objNotesRecordset = objNotesCommand.Execute Set intNotesID = objNotesRecordset(0) Set datNoteDateCreated = objNotesRecordset(1) Set datNoteDateModified = objNotesRecordset(3) [B]Set strObjCityCareNote = objNotesRecordset(2)[/B] Set intNoteModByUserID = objNotesRecordset(4) Set intNoteUserID = objNotesRecordset(5) if intNoteID <>"" then compareDates = DateDiff("d",datNoteDateModified,Date()) end if
Code:
If Not objNotesRecordset.EOF Then %> <% Do While Not objNotesRecordset.EOF %> <tr> <td class="inputlabel" colspan="1"> City Care Note <br /> <% If Len(strObjCityCareNote) > 0 then %> <b> <%Call displayDate(datNoteDateCreated, "-", "MM:HH XM DD MMM YYYY")%></b> <br /> <br /> <%End if %> </td> <td id="demo" class="note" colspan="2"> <% If Len(strObjCityCareNote) <> "" then %> <b> <% Call displayString(strObjCityCareNote,"-")%> [<%Call displayString(strUserFirstName,"") %> <% Call displayString(strUserSurname,"")%> ]</b> <% End If %> <% objNotesRecordset.MoveNext Loop
Comment