|
|
|
Record Paging/Pagination ลองไปแก้แร้วขึ้น error อ่าคับ Too few parameters. Expected 1. |
|
|
|
|
|
|
|
Code (ASP)
<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com ASP & Microsoft Access Tutorial</title>
</head>
<body>
<%
Dim Conn,strSQL,objRec
Set Conn = Server.Createobject("ADODB.Connection")
Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("Network.mdb"),"" , ""
strSQL = "SELECT * FROM Member where Username ='"&session("username")& "'"
Set objRec = Server.CreateObject("ADODB.Recordset")
objRec.Open strSQL, Conn, 1,3
If objRec.EOF Then
Response.write (" Not found record.")
Else
Dim PageLen,PageNo,TotalRecord,TotalPage,No,intID
PageLen = 2
PageNo = Request.QueryString("Page")
if PageNo = "" Then PageNo = 1
TotalRecord = objRec.RecordCount
objRec.PageSize = PageLen
TotalPage = objRec.PageCount
objRec.AbsolutePage = PageNo
%>
<table width="600" border="1">
<tr>
<th width="91"> <div align="center">Username </div></th>
<th width="98"> <div align="center">Sell_ID </div></th>
<th width="198"> <div align="center">Name </div></th>
<th width="97"> <div align="center">Lastname </div></th>
<th width="59"> <div align="center">Phone </div></th>
<th width="71"> <div align="center">Confirm </div></th>
</tr>
<%
No=1
Do While Not objRec.EOF and No <= PageLen
%> <tr>
<td><div align="center"><%=objRec.Fields("User").Value%></div></td>
<td><%=objRec.Fields("Sell_ID").Value%></td>
<td><%=objRec.Fields("Name").Value%></td>
<td><div align="center"><%=objRec.Fields("LastName").Value%></div></td>
<td align="right"><%=objRec.Fields("Phone").Value%></td>
<td align="right"><%=objRec.Fields("Status").Value%></td>
</tr>
<%
No = No + 1
objRec.MoveNext
Loop
%>
</table>
Total : <%=TotalRecord%> Page <%=PageNo%> All Page <%=TotalPage%>
<% IF Cint(PageNo) > 1 then %>
<a href="<%Request.ServerVariables("SCRIPT_NAME")%>?Page=1"><< First</a>
<a href="<%Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo-1%>">< Back</a>
<% End IF%>
<% IF Cint(PageNo) < TotalPage Then %>
<a href="<%Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=PageNo+1%>">Next ></a>
<a href="<%Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=TotalPage%>">Last >></a>
<% End IF%>
<br>
Go to
<% For intID = 1 To TotalPage%>
<% if intID = Cint(PageNo) Then%>
<b><%=intID%></b>
<%Else%>
<a href="<%Request.ServerVariables("SCRIPT_NAME")%>?Page=<%=intID%>"><%=intID%></a>
<%End IF%>
<%Next%>
<%
End IF
objRec.Close()
Conn.Close()
Set objRec = Nothing
Set Conn = Nothing
%>
</body>
</html>
ขึ้นว่า
Code
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/test.asp, line 13
Tag : ASP
|
|
|
|
|
|
Date :
2013-06-19 13:34:21 |
By :
solskjaer16 |
View :
1395 |
Reply :
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตกลงผิดตรงไหนครับ
|
|
|
|
|
Date :
2013-06-19 14:09:37 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|