<%
writeHeader()
Const PAGE_SIZE = 10 '1ページの表示件数
Dim currentPage '現在の表示ページ
Dim sqlProduct, con, recProduct
Dim sqlCategory, recCategory
Dim categoryID
'カテゴリIDがセット済みの場合(QueryStringで渡されないとき)はここから
'カート画面から戻ってきた場合
'If Request.QueryString("categoryID") = "" Then
'Else
'最初の1回は、必ずQueryStringでカテゴリIDが渡される
'カテゴリID保存
' Session("categoryID") = CInt(Request.QueryString("categoryID"))
'End If
categoryID = Request.QueryString("categoryID")
If categoryID = "" Then
categoryID = 0
Else
categoryID = CInt(categoryID)
End If
Set con = Server.CreateObject("ADODB.Connection")
con.Open "Data Source=//nawinfs03/home/users/web/b1922/rh.jinenkan/database/jinenkan_jp.mdb;Provider=Microsoft.Jet.OLEDB.4.0;"
%>
DVD
<%
If invalid = 1 Then
'カテゴリIDが不正な値のは"0"にする
categoryID = 0
End If
Session("categoryID") = categoryID
If Session("categoryID") = 0 Then
sqlProduct="select * from products"
Else
sqlProduct="select * from products where categoryID = " & Session("categoryID")
' “Select * from テーブル名 where name = ‘”&username&”’”
End If
'商品情報の検索
Set recProduct = Server.CreateObject("ADODB.Recordset")
recProduct.Open sqlProduct,con,adLockReadOnly,adCmdText
If recProduct.EOF Then
Response.Write "登録されている商品はありません。"
End If
recProduct.PageSize = PAGE_SIZE
'最初の一回は、ページNoは渡ってこない
If Request.QueryString("pNo")="" Then
currentPage=1
Else
currentPage = CInt(Request.QueryString("pNo"))
End If
recProduct.AbsolutePage = currentPage
%>
<%
'ページインデックスを表示
Dim p
For p = 1 To recProduct.PageCount
If p = currentPage Then
Response.Write " [" & p & "]"
Else
Response.Write " [" & p &"]"
End If
Next
'商品情報レコードセットクローズ
recProduct.Close
Set recProduct = Nothing
con.Close
Set con = Nothing
%>