<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> Papillon Embroidery <% ' ======================================================================================================================================== ' Function to check file Existance ' ======================================================================================================================================== Function IsFileExists(byVal FileName) If FileName = "" Then IsFileExists = False Exit Function End If Dim objFSO Set objFSO = Server.CreateObject("Scripting.FileSystemObject") If objFSO.FileExists( FileName ) = True Then IsFileExists = True Else IsFileExists = False End If Set objFSO = Nothing End Function On Error Resume Next ' ====================================================== ' Open database connection and recordset Dim objConn, objRS, ConnString ConnString = "Driver={MySQL};SERVER=" & "localhost" & ";DATABASE=" & "web93-pap123" & ";UID=" & "web93-pap123" & ";PWD=" & "libra27" Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open ConnString 'objConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database/products.mdb") Set objRS = Server.CreateObject("ADODB.Recordset") objRS.ActiveConnection = objConn objRS.Source = "SELECT * FROM tblCategory ORDER BY CategoryOrder ASC;" objRS.Open() Dim arrayRS arrayRS = objRS.GetRows() objRS.Close Set objRS = Nothing ' Load into array Dim DispArray(20), i, iRow, iCol, tmpString, BlankNow, imgName, fileName iRow = 0 BlankNow = False For i = 0 To 20 Step 1 If BlankNow = True Then tmpString = "
" Else fileName = Server.MapPath("images/category_images/" & arrayRS(0,iRow) & ".jpg") If IsFileExists(fileName) = True Then imgName = arrayRS(0,iRow) Else imgName = "blank" End If tmpString = "
" tmpString = tmpString & "" tmpString = tmpString & "
" tmpString = tmpString & "" & arrayRS(1,iRow) & "
" End If DispArray(i) = tmpString If Not iRow = UBound(arrayRS, 2) Then iRow = iRow + 1 Else BlankNow = True End If Next ' ====================================================== %>
 
<%= DispArray(0) %> <%= DispArray(1) %> <%= DispArray(2) %> <%= DispArray(3) %> <%= DispArray(4) %> <%= DispArray(5) %> <%= DispArray(6) %>
<%= DispArray(7) %> <%= DispArray(8) %> <%= DispArray(9) %> <%= DispArray(10) %> <%= DispArray(11) %> <%= DispArray(12) %> <%= DispArray(13) %>
<%= DispArray(14) %> <%= DispArray(15) %> <%= DispArray(16) %> <%= DispArray(17) %> <%= DispArray(18) %> <%= DispArray(19) %> <%= DispArray(20) %>
Copyright © Papillon Embroidery 2007
Maintained by MPS Software Ltd