<%@LANGUAGE="VBSCRIPT"%> <% OPTION EXPLICIT %> Lombok Moda - Aparador virtual

 

lombok@andorra.ad
 

Aparador Virtual

" & vbCRLF Else objRS.AbsolutePosition = intPosition 'if necessary, check for blank field values and print blank cell If objRS.Fields("Ident") = "" Then Response.Write "" & vbCRLF Else Response.Write "" & vbCRLF End If End If End Sub %>
<% Const adOpenStatic = 3 Const adCmdText = &H0001 Const TITLE = "Lombok Moda" dim objRS 'Recordset object dim objRS2 'Recordset object dim strSQL 'SQL string dim strSQL2 'SQL string 2 dim intSize 'user defined dimension of table '(could be number of rows or cols) dim intOtherSize 'other dimension of table '(could be number of rows or cols) dim strLayoutType 'whether intSize refers to (C)olumns or (R)ows dim strOrientation 'direction of output: (V)ertical or (H)orizontal dim intNumRecs 'number of records in the database dim intNumCols 'number of columns in table dim intNumRows 'number of rows in table dim intRowIndex 'placeholder for current row dim intColIndex 'placeholder for current column dim intPosition 'placeholder for current record dim MM_entitats_STRING %> <% 'create recordset object Set objRS = Server.CreateObject("ADODB.Recordset") 'connect via ODBC objRS.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../../bases/lombokmoda/lombok.mdb") '## MS Access 2000 on Brinkster 'or connect to database via OLEDB 'create recordset object %> <% strSQL = "SELECT * " strSQL = strSQL & "FROM Gamma " strSQL = strSQL & "ORDER BY Ident ASC;" 'execute SQL statement objRS.Open strSQL, ,adOpenStatic , , adCmdText %> <% If objRS.EOF And objRS.BOF Then %> En aquest moment, no hi ha cap producte. <% else 'retrieve parameters intSize = 3 strOrientation = "H" strLayoutType = "C" Response.Write "" & vbCRLF 'get the number of records in the database intNumRecs = objRS.RecordCount 'if size was not passed in then set size equal to the number of records If intSize = "" Then intSize = intNumRecs End If 'get other dimension of the table If intNumRecs Mod intSize = 0 Then intOtherSize = intNumRecs / intSize Else intOtherSize = Int((intNumRecs / intSize)) + 1 End If 'set variables for table size If strLayoutType = "C" Then intNumRows = intOtherSize intNumCols = intSize Else'If strLayoutType = "R" Then intNumRows = intSize intNumCols = intOtherSize End If 'span the number of columns in the table with the title 'Response.Write "" & vbCRLF 'loop thru table by row For intRowIndex = 1 To intNumRows Response.Write "" & vbCRLF If strOrientation = "V" Then intPosition = intRowIndex 'loop thru table by column For intColIndex = 1 To intNumCols PrintRecord intPosition = intPosition + intNumRows Next Else 'otherwise assume "H" 'loop thru table by column For intColIndex = 1 To intNumCols intPosition = intColIndex + ((intRowIndex - 1) * intNumCols) PrintRecord Next End If Response.Write "" & vbCRLF Next Response.Write "
 
" & vbCRLF End If 'clean up and close the database objRS.Close Set objRS = Nothing sub PrintRecord 'if position is past EOF print a blank cell If intPosition > intNumRecs Then Response.Write "
  " & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "
  
" & vbCRLF 'Response.Write "" Response.Write "" Response.Write "
" & vbCRLF Set objRS2 = Server.CreateObject("ADODB.Recordset") objRS2.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../../../bases/lombokmoda/lombok.mdb") '## MS Access 2000 on Brinkster strSQL2 = "SELECT * " strSQL2 = strSQL2 & "FROM Productes " strSQL2 = strSQL2 & "WHERE Ident = " & objRS.Fields("Ident") & " " strSQL2 = strSQL2 & "ORDER BY ID ASC;" 'response.Write strSQL2 'execute SQL statement objRS2.Open strSQL2, ,adOpenStatic , , adCmdText Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF do until objRS2.EOF 'if objRS.Fields("Gamma") <> objRS2.Fields("Producte") then Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF 'end if Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF if objRS2.Fields("Preu_oferta") <> "0" then Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF end if Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF objRS2.Movenext loop Response.Write "
 " Response.Write objRS.Fields("Gamma") Response.Write "
  " Response.Write objRS2.Fields("Producte") Response.Write ":
 " Response.Write objRS2.Fields("Descripcio") Response.Write "
 " if objRS2.Fields("Novetat") <> 0 then Response.Write "Novetat" else Response.Write " " end if Response.Write "
 - Preu: " Response.Write objRS2.Fields("Preu") Response.Write " €uros
 - Preu oferta: " Response.Write objRS2.Fields("Preu_oferta") Response.Write "
  
" & vbCRLF Response.Write "