>
<% For x = 1 to intFieldCount
If Mid(strDisplay, x, 1) = "1" Then %>
| <%=arrFieldNames(x-1)%> |
<% curVal = aFields(x,4)
' Blank / Null / Empty
If IsNull(curVal) OR (Trim(curVal) & "x" = "x") Then curVal = " "
' Password
If UCase(Left(aFields(x,1),8)) = "PASSWORD" Then curVal = "*****"
' Format the various field types
' See if the field is an alias for another description (from dbCombo)
strCombo = "dbCombo" & CStr(x)
If Trim(Session(strCombo)) & "x" = "x" Then
Select Case aFields(x,2)
case 2, 3, 4, 5 ' Numbers
curVal = " " & curVal & " "
case 6 ' Currency
curval = "" & FormatCurrency(curval,2,-1) & " "
case 7, 135 ' Date / Time - Fixed for Null values by Elizabeth Robins
if curVal <> " " then curVal = FormatDateTime(curVal, Mid(strFormatDate, x, 1))
case 11 ' Boolean
If curVal Then
curVal = txtTrue
Else
curVal = txtFalse
End If
case 129, 130, 200, 201, 202, 203 ' String or Memo
IsLink = False
' Image
If (UCase(Left(aFields(x,1),3)) = "IMG") Then
IsLink = True
If Session("dbMaxImageSize") = 0 Then
curVal = LT & "IMG SRC=" & QUOTE & curVal & QUOTE & GT
Else
curVal = LT & "IMG SRC=" & QUOTE & curVal & QUOTE & " WIDTH=" & QUOTE & Session("dbMaxImageSize") & QUOTE & GT
End If
End If
' Check for E-mail address
strContainsURL = "dbEMailfor" & CStr(x)
If (Session(strContainsURL) > 0) Then
IsLink = True
strURL = aFields(Session(strContainsURL),4)
If Trim(strURL) & "x" <> "x" Then
strURL = Replace(strURL,"mailto:","")
strURL = "mailto:" & LTrim(strURL)
curVal = "" & curVal & ""
End If
End If
' Check for hyperlink
strContainsURL = "dbURLfor" & CStr(x)
If Session(strContainsURL) <> 0 Then
IsLink = True
strURL = aFields(Session(strContainsURL),4)
If strURL & "x" <> "x" Then
curVal = "" & curVal & ""
' *** Uncomment the following line to strip all #'s from hyperlink fields
' curVal = Replace(curVal,"#","")
End If
Else
If (UCase(Left(curVal,7)) = "HTTP://") Then
IsLink = True
curVal = LT & "A HREF=" & QUOTE & curVal & QUOTE & GT & curVal & LT & "/A" & GT
' *** Uncomment the following line to strip all #'s from Access hyperlink fields
' curVal = Replace(curVal,"#","")
End If
End If
if NOT IsLink then
curVal = replace(curVal,"<","<")
curVal = replace(curVal,">",">")
end if
curVal = replace(curVal,chr(10)," ")
End Select
else
' Look up the value to display
arrCombo = Split(Session(strCombo),",")
' LIST
If Trim(UCase(arrCombo(0))) = "LIST" Then
curVal = ""
y = 1
While y < UBound(arrCombo)
arrCombo(y) = LTrim(arrCombo(y))
arrCombo(y+1) = LTrim(arrCombo(y+1))
if arrCombo(y) = LTrim(aFields(x,4)) then
curVal = arrCombo(y+1)
y = uBound(arrCombo)
end if
y = y + 2
wend
End If
' TABLE
If (Trim(UCase(arrCombo(0))) = "TABLE") OR (Trim(UCase(arrCombo(0))) = "TBL") Then
strComboTable = Trim(arrCombo(1))
strComboValueFldNo = CInt(arrCombo(2))-1
strComboDescFldNo = CInt(arrCombo(3))-1
strsql = "SELECT * FROM [" & strComboTable & "]"
If strType = "SQL" Then
strsql = Replace(strsql,"[","")
strsql = Replace(strsql,"]","")
End If
set xConn = Server.CreateObject("ADODB.Connection")
xConn.Open strConn
set tlkpRs = Server.CreateObject("ADODB.Recordset")
tlkpRs.Open strsql, xConn, 1, 2
select case tlkpRs.Fields(strComboValueFldNo).Type
case 2, 3, 4, 5, 6 ' Numbers, Currency
tlkpRs.Find tlkpRs.Fields(strComboValueFldNo).Name & " = " & aFields(x,4), 0
case 11 ' Boolean
tlkpRs.Find tlkpRs.Fields(strComboValueFldNo).Name & " = " & aFields(x,4), 0
case 129, 130, 200, 201, 202, 203 ' String or Memo
tlkpRs.Find tlkpRs.Fields(strComboValueFldNo).Name & " LIKE '" & curVal & "'", 0
end select
if not tlkpRs.EOF then curval = tlkpRs.Fields(strComboDescFldNo)
tlkpRs.Close
Set tlkpRs = Nothing
xConn.Close
Set xConn = Nothing
end if
end if
Response.Write curVal %>
|
<%
End If
Next %>
|