<% Dim sKomokuNo(10) Dim sKomokuName(10) Dim nItem Dim nPageSize, nPageCount Dim sDaibunrui Dim conDB Dim rsGazou %> 検索結果一覧 <%Initialize%>

検索結果一覧

<%OutputPage%>
<%SetPageButton%>
<%OutputData%>
<% If rsGazou.PageCount = 0 Then Response.Write "
該当するデータは1件もありません。" End If %>

<% Private Sub OutputPage() Response.Write "" & vbcrlf Response.Write "" & rsGazou.RecordCount & "件" & vbvrlf Response.Write "" & nPageCount & "/" & rsGazou.PageCount & "ページ" & vbcrlf Response.Write "" & vbcrlf End Sub Private Sub Initialize() GetParameter GetItemInfo if Not IsObject(rsGazou) Then CreateIchiranRS End If End Sub Private Sub GetParameter() nPageSize = 10 '遺品DBオブジェクト取得 Set conDB = Session("xxxNDB") Select Case Request("PageMove") Case "前ページ" Set rsGazou = Session("IchiranRS") nPageCount = Session("PageCount") - 1 sDaibunrui = Session("Daibunrui") Case "次ページ" Set rsGazou = Session("IchiranRS") nPageCount = Session("PageCount") + 1 sDaibunrui = Session("Daibunrui") Case Else nPageCount = 1 sDaibunrui = Request("Daibunrui") Session("Daibunrui") = sDaibunrui End Select Session("PageCount") = nPageCount End Sub Private Sub GetItemInfo() 'コントロールテーブルから一覧表示内容を取得SQL Sql = "SELECT 項目番号,項目名称,一覧表示フラグ FROM M_CONTROL " & _ "WHERE 大分類コード='" & sDaibunrui & "' " & _ "ORDER BY 項目番号" Set rsControl = conDB.Execute(Sql) 'コントロールテーブルから一覧表示内容を取得 nItem = 0 Do While (Not rsControl.Eof) If rsControl.Fields("一覧表示フラグ") = True Then nItem = nItem + 1 sKomokuNo(nItem) = rsControl.Fields("項目番号") sKomokuName(nItem) = rsControl.Fields("項目名称") End If rsControl.MoveNext Loop rsControl.Close End Sub Private Sub CreateIchiranRS() 'SQL抽出項目編集 SqlSelect = "画像フォルダID,画像ID" For i = 1 To nItem SqlSelect = SqlSelect + ",属性" & sKomokuNo(i) Next 'SQL検索条件編集 SqlWhere = "大分類コード='" & Request("Daibunrui") & "'" If Request("Chubunrui") <> "" then SqlWhere = SqlWhere & " AND 中分類コード='" & Request("Chubunrui") & "'" End If If Request("Shobunrui") <> "" then SqlWhere = SqlWhere & " AND 小分類='" & Request("Shobunrui") & "'" End If For i = 1 To 10 sZokusei = "Zokusei" & i If Request(sZokusei) <> "" Then sField = "属性" & Right("0" & i, 2) SqlWhere = SqlWhere & " AND " & sField & "='" & Request(sZokusei) & "'" End If Next If Request("Zokusei2F") <> "" Then 'SqlWhere = SqlWhere & " AND " & "CDate(属性02)>=CDate('" & Request("Zokusei2F") & "')" SqlWhere = SqlWhere & " AND " & "属性02>='" & Request("Zokusei2F") & "'" End If If Request("Zokusei2T") <> "" Then 'SqlWhere = SqlWhere & " AND " & "CDate(属性02)<=CDate('" & Request("Zokusei2T") & "')" SqlWhere = SqlWhere & " AND " & "属性02<='" & Request("Zokusei2T") & "'" End If 'SQLオーダ編集 SqlOrder = "属性01,画像フォルダID,画像ID" 'SQL文編集&実行 Sql = "SELECT " & SqlSelect & " FROM F_GAZOU WHERE " & SqlWhere & " ORDER BY " & SqlOrder Set rsGazou = CreateObject("ADODB.Recordset") rsGazou.CursorLocation = 3'adUseClient rsGazou.PageSize = nPageSize rsGazou.Open Sql, conDB, adOpenKeyset Set Session("IchiranRS") = rsGazou End Sub Private Sub OutputData() On Error Resume Next '表のヘッダ(見出し)を出力 Response.Write "" & vbcrlf For i = 1 To nItem Response.Write "" & sKomokuName(i) & "" & vbcrlf Next Response.Write "" & vbcrlf rsGazou.AbsolutePage = nPageCount '検索結果出力 For j = 1 To nPageSize If rsGazou.Eof Then Exit For End If Response.Write "" & vbcrlf For i = 1 To nItem Response.Write "" If i = 1 Then Response.Write "" End If sData = rsGazou.Fields("属性" & sKomokuNo(i)) If IsNull(sData) Then If i = 1 Then sData = "*未設定*" Else sData = " " End If End If Response.Write sData & "" & vbcrlf Next Response.Write "" & vbcrlf rsGazou.MoveNext Next End Sub Private Sub SetPageButton() If nPageCount < rsGazou.PageCount Then sDisabled = "" Else sDisabled = " disabled" End If Response.Write "" & vbcrlf If nPageCount > 1 Then sDisabled = "" Else sDisabled = " disabled" End If Response.Write "" & vbcrlf Response.Write "" & vbcrlf End Sub %>