function openDB()
dim conn
set conn = server.createobject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA SOURCE=;UID=;PWD=;DATABASE="
openDB = conn
end function
Dim sBgcolor
if (i mod 2 = 0) then
sBgcolor = "#eee"
else
sBgcolor = "#fff"
end if
<tr style="background-color:<%=sBgcolor%>;" onMouseOver="this.style.background='#ddd;'" onMouseOut="this.style.background='<%=sBgcolor%>;'">
sub getChildren(rowId)
Dim sSQL,oRS,itemArray,i
sSQL = "SELECT rowId,rowName,parent_id from table WHERE parent_id = " & rowId
set oRS = cn.execute(sSQL)
itemArray = oRS.getRows()
if isArray(itemArray) then
dim rowId,rowName,parent_id
for i = 0 to ubound(itemArray,2)
rowId = itemArray(0,i)
rowName = itemArray(1,i)
parent_id = itemArray(2,i)
call getChildren(parent_id) 'pass in parent id here
response.write " >> <a href=""page.asp?p="&rowId&""">"&rowName&"</a>"
next
end if
end sub
'accepts: file name string
'returns: 3 letter file extension
function getFileExt(fileName)
getFileExt = Mid(fileName, InstrRev(fileName, ".") + 1)
end function
Dim iContentPerPage: iContentPerPage = 10
Dim iRowCutoff: iRowCutoff = 3 'number of columns
Dim iTotal: iTotal = Ubound(itemArray,2) 'total number of results
Dim iStart: iStart = request.querystring("start")
'set the starting position, either zero or from the query string
if (len(iStart) = 0) then
iStart = 0
else
iStart = Cint(iStart)
end if
'set the end position
'if the number of items per page plus the starting position is less than the total,
'then show the number of items added to the starting position
'otherwise we are at the end
If (iTotal >= (iContentPerPage + iStart)) Then
iEnd = iContentPerPage + iStart - 1
Else
iEnd = iTotal
End If
response.write "<table width=""99%"" border=""0"" cellspacing=""0"" cellpadding=""2""><TR>"
'loop through the results
For introw = iStart to iEnd
iID = arrArray(0,i)
'start a new row every 3 pictures
if (k mod iRowCutoff = 0) then _
response.write "</tr><tr>"
response.write "<td>Content</td>"
Next
response.write "</table>"
response.write "<br /><table border=""0"" width=""95%"" cellpadding=""2"" cellspacing=""0"" align=""center""><tr>"
'check whether to show the previous link or not
if (iStart > 0) then
response.write "<td style=""width:33%;"" align=""left""><a href="""&scriptName&"?start="&iStart-iContentPerPage&"&id="&id&""" style=""text-decoration:none;""><< PREVIOUS PAGE</a></td>"
else
response.write "<td style=""width:33%;"">&nbsp;</td>"
end if
response.write "<td style=""width:33%;"" align=""center"">" & (iEnd+1) & " of " & (iTotal+ 1) & "</td>"
'check whether to show the next link or not
if (iEnd < iTotal) then
response.write "<td style=""width:33%;"" align=""right""><a href="""&scriptName&"?start="&iStart+iContentPerPage&"&id="&id&""" style=""text-decoration:none;"">NEXT PAGE >></a></td>"
else
response.write "<td style=""width:33%;"">&nbsp;</td>"
end if