The problem is that dates are showing up incorrectly when returned from a stored procedure: i.e. 12:00:00 AM (when using CDate conversion), or 12/30/1899 (via rs("columnname").Value)
Here is the ASP code:
Vars is just a semicolon delimited list of column names to return. Each VarName is the column name.
Thanks for any help.
Here is the ASP code:
Code:
If not rs.BOF and not rs.EOF Then
Do Until rs.EOF
%> <tr>
<td><%=rs("OSVer")%></td> <%
Vars = rs2("Vars") + " "
do while instr(2,Vars,";")
VarName = cstr( left( Vars, instr(1,Vars,";") - 1 ) )
Response.Write("<td>")
if not isnull(rs(VarName)) then
if rs(VarName).Type = 135 then ' isdate (ADODataTypeEnum values: 135=adDBTimeStamp)
d = rs(VarName)
' Response.Write(CDate(rs(VarName))) ' date shows up as 12:00:00 AM
Response.Write(FormatDateTime(rs(VarName),2) ) ' date shows up as 12/30/1899
else ' non date
Response.Write(rs(VarName).Value)
end if
end if
Response.Write("</td>")
Vars = mid(Vars, instr(1,Vars,";") + 1)
Loop
rs.MoveNext
%> </tr> <%
Loop
End If
Vars is just a semicolon delimited list of column names to return. Each VarName is the column name.
Thanks for any help.