Hello.
I'm having a problem with a RecToTable results page. The code I have works on my PC perfectly fine, but when I copied the files to the Production servers, part of the values don't show up.
Code:
<!-- METADATA TYPE="typelib"
FILE="C:\Program Files\Common Files\System\ado\msado15.dll" -->
<%
Response.Expires=0
Dim objRS, strConnect, strCriteria, strSQL, blnExport
Set objRS = Server.CreateObject("ADODB.Recordset")
If Request("Clause") <> "" Then
strSQL = "SELECT * FROM Snap_in WHERE Clause LIKE '" & Request("Clause") & "'"
Else
strSQL = "SELECT * FROM Snap_in"
End If
objRS.Open strSQL, strConnect
If Request("Keyword") <> "" Then
objRS.Filter = "Snap_in LIKE '*" & Request("Keyword") & "*'"
End If
' now loop through the records
Response.Write "<TABLE BORDER=1><TR ALIGN=CENTER><TD bgcolor=#ffc6a5>Needs Legal Approval</TD></TR></TABLE>"
If objRS.EOF Then
Response.Redirect "Welcome.asp?Action=Retry"
Else
Response.Write RecToTableAll(objRS) ' pass the recordset to the table function
End If
' now close and clean up
objRS.Close
Set objRS = Nothing
%>
<SCRIPT language="JavaScript">
function Approval()
{
alert("This snap-in clause is subject to prior review and approval for use by the applicable HP Attorney for the opportunity and BU.");
}
</SCRIPT>
<%
Dim strT ' table html string
Dim fldF ' current field object
Dim intFCount ' counts number of fields
Dim Link ' indicates when to insert link
Function RecToTableAll(objRS)
strT = strT & "<H3>You must select the desired clause(s) and submit, before copying is allowed</H3>"
strT = strT & "<form Action=Test.asp method=Post><TABLE BORDER=1><TR ALIGN=CENTER>" ' build the table header
For Each fldF In objRS.Fields ' each field as a table column name
Select Case (fldF.Name)
Case "Approval", "Selected_Count"
strT = strT & ""
Case "Snap_in_ID"
strT = strT & "<TD bgcolor=#cccccc><B>Select Clause</B></TD>"
Case Else
strT = strT & "<TD bgcolor=#cccccc><B>" & (Replace(fldF.Name,"_"," ")) & "</B></TD>"
End Select
Next
strT = strT & "</TR>"
While Not objRS.EOF ' now build the rows
strT = strT & "<TR ALIGN=CENTER>"
For Each fldF In objRS.Fields ' loop through the fields
Select Case (fldF.Name)
Case "Snap_in_ID"
strT = strT & "<TD><input type=checkbox name=selectclause value=" & objRS("Snap_in_ID") & "></TD>"
Case "Clause"
strT = strT & "<TD>" & objRS("Clause") & "</TD>"
Case "Snap_in"
If objRS("Approval").value = true Then
strT = strT & "<TD bgcolor=#ffc6a5>" & Highlight_Text(objRS("Snap_in")) & "</TD>"
Else
strT = strT & "<TD>" & Highlight_Text(objRS("Snap_in")) & "</TD>"
End If
Case "Notes"
strT = strT & "<TD>" & objRS("Notes") & "</TD>"
Case"File"
If fldF.Value <> "" Then
strT = strT & "<TD><a href=" & objRS("File") & ">Related file</a></TD>"
Else
strT = strT & "<TD></TD>"
End If
End Select
Next
strT = strT & "</TR>"
objRS.MoveNext
Wend
strT = strT & "<input type=submit value=submit><input type=hidden name=Keyword value=" & Request("Keyword") & "></form></TABLE>"
RecToTableAll = strT ' and finally return the table
End Function
%>
for some reason, the checkbox and the cluase show up, no Snap_in, no Notes, no File link. the only file I could'nt copy over was the .mdf and .ldf files, which I'm not sure if they would make any difference or not. If the cluse shows up, why not the rest
Thanks for any advice :)