home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 July & August
/
Pcwk78a98.iso
/
Micrsoft
/
VJ
/
COMMON
/
WIZARD98
/
VIWZ1.DLL
/
1033
/
HTMX
/
5531
< prev
next >
Wrap
Text File
|
1998-02-24
|
8KB
|
232 lines
<%@ LANGUAGE="VBScript" %>
<%
'-------------------------------------------------------------------------------
' Microsoft Visual InterDev - Data Form Wizard
'
' List Page
'
' (c) 1997 Microsoft Corporation. All Rights Reserved.
'
' This file is an Active Server Page that contains the list view of a Data Form.
' It requires Microsoft Internet Information Server 3.0 and can be displayed
' using any browser that supports tables. You can edit this file to further
' customize the list view.
'
'-------------------------------------------------------------------------------
Dim strPagingMove
Dim strDFName
strDFName = "rs<%#TableShortName#%>"
%>
<SCRIPT RUNAT=Server LANGUAGE="VBScript">
'---- DataTypeEnum Values ----
Const adUnsignedTinyInt = 17
Const adBoolean = 11
Const adLongVarChar = 201
Const adLongVarWChar = 203
Const adBinary = 128
Const adVarBinary = 204
Const adLongVarBinary = 205
'-------------------------------------------------------------------------------
' Purpose: Substitutes Empty for Null and trims leading/trailing spaces
' Inputs: varTemp - the target value
' Returns: The processed value
'-------------------------------------------------------------------------------
Function ConvertNull(varTemp)
If IsNull(varTemp) Then
ConvertNull = ""
Else
ConvertNull = Trim(varTemp)
End If
End Function
'-------------------------------------------------------------------------------
' Purpose: Embeds bracketing quotes around the string
' Inputs: varTemp - the target value
' Returns: The processed value
'-------------------------------------------------------------------------------
Function QuotedString(varTemp)
If IsNull(varTemp) Then
QuotedString = Chr(34) & Chr(34)
Else
QuotedString = Chr(34) & CStr(varTemp) & Chr(34)
End If
End Function
'-------------------------------------------------------------------------------
' Purpose: Tests string to see if it is a URL by looking for protocol
' Inputs: varTemp - the target value
' Returns: True - if is URL, False if not
'-------------------------------------------------------------------------------
Function IsURL(varTemp)
IsURL = True
If UCase(Left(Trim(varTemp), 6)) = "HTTP:/" Then Exit Function
If UCase(Left(Trim(varTemp), 6)) = "FILE:/" Then Exit Function
If UCase(Left(Trim(varTemp), 8)) = "MAILTO:/" Then Exit Function
If UCase(Left(Trim(varTemp), 5)) = "FTP:/" Then Exit Function
If UCase(Left(Trim(varTemp), 8)) = "GOPHER:/" Then Exit Function
If UCase(Left(Trim(varTemp), 6)) = "NEWS:/" Then Exit Function
If UCase(Left(Trim(varTemp), 7)) = "HTTPS:/" Then Exit Function
If UCase(Left(Trim(varTemp), 8)) = "TELNET:/" Then Exit Function
If UCase(Left(Trim(varTemp), 6)) = "NNTP:/" Then Exit Function
IsURL = False
End Function
'-------------------------------------------------------------------------------
' Purpose: Handles the display of a field from a recordset depending
' on its data type, attributes, and the current mode.
' Assumes: That the recordset containing the field is open
' Inputs: strFieldName - the name of the field in the recordset
' avarLookup - array of lookup values
'-------------------------------------------------------------------------------
Function ShowField(strFieldName, avarLookup)
Dim intRow
Dim strPartial
Dim strBool
Dim nPos
strFieldValue = ""
nPos=Instr(strFieldName,".")
Do While nPos > 0
strFieldName= Mid (strFieldName, nPos+1)
nPos=Instr(strFieldName,".")
Loop
If Not IsNull(avarLookup) Then
Response.Write "<TD BGCOLOR=White NOWRAP><FONT SIZE=-1>"
For intRow = 0 to UBound(avarLookup, 2)
If ConvertNull(avarLookup(0, intRow)) = ConvertNull(rs<%#TableShortName#%>(strFieldName)) Then
Response.Write Server.HTMLEncode(ConvertNull(avarLookup(1, intRow)))
Exit For
End If
Next
Response.Write "</FONT></TD>"
Exit Function
End If
Select Case rs<%#TableShortName#%>(strFieldName).Type
Case adBoolean, adUnsignedTinyInt 'Boolean
strBool = ""
If rs<%#TableShortName#%>(strFieldName) <> 0 Then
strBool = "True"
Else
strBool = "False"
End If
Response.Write "<TD BGCOLOR=White ><FONT SIZE=-1>" & strBool & "</FONT></TD>"
Case adBinary, adVarBinary, adLongVarBinary 'Binary
Response.Write "<TD BGCOLOR=White ><FONT SIZE=-1>[Binary]</FONT></TD>"
Case adLongVarChar, adLongVarWChar 'Memo
Response.Write "<TD BGCOLOR=White NOWRAP><FONT SIZE=-1>"
strPartial = Left(rs<%#TableShortName#%>(strFieldName), 50)
If ConvertNull(strPartial) = "" Then
Response.Write " "
Else
Response.Write Server.HTMLEncode(strPartial)
End If
If rs<%#TableShortName#%>(strFieldName).ActualSize > 50 Then Response.Write "..."
Response.Write "</FONT></TD>"
Case Else
Response.Write "<TD BGCOLOR=White ALIGN=Left NOWRAP><FONT SIZE=-1>"
If ConvertNull(rs<%#TableShortName#%>(strFieldName)) = "" Then
Response.Write " "
Else
' Check for special field types
Select Case UCase(Left(rs<%#TableShortName#%>(strFieldName).Name, 4))
Case "URL_"
Response.Write "<A HREF=" & QuotedString(rs<%#TableShortName#%>(strFieldName)) & ">"
Response.Write Server.HTMLEncode(ConvertNull(rs<%#TableShortName#%>(strFieldName)))
Response.Write "</A>"
Case Else
If IsURL(rs<%#TableShortName#%>(strFieldName)) Then
Response.Write "<A HREF=" & QuotedString(rs<%#TableShortName#%>(strFieldName)) & ">"
Response.Write Server.HTMLEncode(ConvertNull(rs<%#TableShortName#%>(strFieldName)))
Response.Write "</A>"
Else
Response.Write Server.HTMLEncode(ConvertNull(rs<%#TableShortName#%>(strFieldName)))
End If
End Select
End If
Response.Write "</FONT></TD>"
End Select
End Function
</SCRIPT>
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<META NAME="Keywords" CONTENT="Microsoft Data Form, <%#FormName#%> List">
<TITLE><%#FormName#%> List</TITLE>
</HEAD>
<!--------------------------- Formatting Section ------------------------------>
<BASEFONT FACE="Arial, Helvetica, sans-serif">
<LINK REL=STYLESHEET HREF="./Stylesheets/<%#THEMENAME#%>/Style2.css">
<BODY BACKGROUND="./Images/<%#THEMENAME#%>/Background/Back2.jpg" BGCOLOR=White>
<!---------------------------- Lookups Section ------------------------------->
<%#ForeignKeyRS#%>
<!---------------------------- Heading Section ------------------------------->
<% Response.Write "<FORM ACTION=<%#DataFormFileName#%> METHOD=""POST"">" %>
<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR>
<TH NOWRAP BGCOLOR=Silver ALIGN=Left BACKGROUND="./Images/<%#THEMENAME#%>/Navigation/Nav1.jpg" >
<FONT SIZE=6> <%#FormName#%></FONT>
</TH>
<TD BGCOLOR=Silver VALIGN=Middle ALIGN=Right WIDTH=100% BACKGROUND="./Images/<%#THEMENAME#%>/Navigation/Nav1.jpg">
<INPUT TYPE="Hidden" NAME="FormMode" VALUE="Edit">
<%#ChangeToFormView#%>
</TD>
</TR>
<%#StatusLineList#%></TABLE>
</FORM>
<!----------------------------- List Section --------------------------------->
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100% >
<TR>
<TD WIDTH=20> </TD>
<TD>
<TABLE CELLSPACING=1 CELLPADDING=1 BORDER=0 WIDTH=100% >
<TR BGCOLOR=SILVER VALIGN=TOP>
<TD ALIGN=Center><FONT SIZE=-1> # </FONT></TD>
<%#DisplayFieldListHTML#%> </TR>
<%#DataRangeHeaderHTMLList#%>
<TR VALIGN=TOP>
<TD BGCOLOR=White><FONT SIZE=-1>
<%#HotLinkHTML#%> </FONT></TD>
<%
<%#RemainingFields#%> fHideRule = True
%>
</TR>
<%#DataRangeFooterHTMLList#%>
<!---------------------------- Footer Section -------------------------------->
<%
' TEMP: cache here until CacheRecordset property is implemented in
' data range
If fNeedRecordset Then
Set Session("rs<%#TableShortName#%>_Recordset") = rs<%#TableShortName#%>
End If
%>
</TD></TR></TABLE>
</BODY>
</HTML>