Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > ASP > ASP Microsoft Access > ASP Microsoft Access Multiple Column and Paging/Pagination



Clound SSD Virtual Server

ASP Microsoft Access Multiple Column and Paging/Pagination

ASP Microsoft Access Multiple Column and Paging/Pagination ตัวอย่างนี้จะเป็นการเขียนโปรแกรม ASP กับ Access โดยมีการดึงข้อมูลมาจาก Table แสดงผลออกเป็น Column (คอลัมบ์) และแบ่งออกเป็นหลาย ๆ หน้า Paging/Pagination

ตัวอย่าง

AspAccessColumnPaging.asp

<% Option Explicit %>
<html>
<head>
<title>ThaiCreate.Com Tutorial</title>
</head>
<body>
<%
	Dim Conn,strSQL,objRec,intRows
	Set Conn = Server.Createobject("ADODB.Connection")
	Conn.Open "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("db/mydatabase.mdb"),"" , ""

	strSQL = "SELECT * FROM gallery "
	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 = 4
		PageNo = Request.QueryString("Page")
		if PageNo = "" Then PageNo = 1
		TotalRecord = objRec.RecordCount
		objRec.PageSize = PageLen
		TotalPage = objRec.PageCount
		objRec.AbsolutePage = PageNo

		Response.Write("<table border='0' cellspacing='1' cellpadding='1'><tr>")
		

		No=1
		Do While Not objRec.EOF and No <= PageLen

			Response.Write("<td>")
%>
			<center>
				<img src="thaicreate/<%=objRec.Fields("Picture").Value%>"><br>
				<%=objRec.Fields("GalleryName").Value%>
				<br>
			</center>
<%
			Response.Write("</td>")
			If No Mod 2 = 0 Then
				Response.Write("</tr>")
			End If
			
		No = No + 1
		objRec.MoveNext
		Loop

		Response.Write("</tr></table>")
		
	End If
	
	objRec.Close()
	Conn.Close()
	Set objRec = Nothing
	Set Conn = Nothing
%>
	<br>
	Total : <%=TotalRecord%> Records.  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%>
</body>
</html>

Screenshot

ASP & Ms Access






   
Share


ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท


ลองใช้ค้นหาข้อมูล


   


Bookmark.   
       
  By : ThaiCreate.Com Team (บทความเป็นลิขสิทธิ์ของเว็บไทยครีเอทห้ามนำเผยแพร่ ณ เว็บไซต์อื่น ๆ)
  Score Rating :  
  Create/Update Date : 2010-08-07 09:38:08 / 2010-08-07 09:57:07
  Download : Download  ASP Microsoft Access Multiple Column and Paging/Pagination
 Sponsored Links / Related

 
ASP Microsoft Access Connect to Database
Rating :

 
ASP Microsoft Access List Table Properties
Rating :

 
ASP Microsoft Access List Record
Rating :

 
ASP Microsoft Access List Record (ODBC)
Rating :

 
ASP Microsoft Access Random Record
Rating :

 
ASP Microsoft Access List Record Paging/Pagination
Rating :

 
ASP Microsoft Access Search Record
Rating :

 
ASP Microsoft Access Search Record Paging/Pagination
Rating :

 
ASP Microsoft Access Multiple Column
Rating :

 
ASP Microsoft Access Add/Insert Record
Rating :

 
ASP Microsoft Access Transaction (BeginTrans,CommitTrans,RollbackTrans)
Rating :

 
ASP Microsoft Access Check Already Exists Add/Insert Record
Rating :

 
ASP Microsoft Access Edit/Update Record
Rating :

 
ASP Microsoft Access Delete Record
Rating :

 
ASP Microsoft Access Multiple Checkbox Delete Record
Rating :

 
ASP Microsoft Access Used Include Function
Rating :

 
ASP Microsoft Access Used Function Database Query
Rating :

 
ASP Microsoft Access Database Class
Rating :


ThaiCreate.Com Forum


Comunity Forum Free Web Script
Jobs Freelance Free Uploads
Free Web Hosting Free Tools

สอน PHP ผ่าน Youtube ฟรี
สอน Android การเขียนโปรแกรม Android
สอน Windows Phone การเขียนโปรแกรม Windows Phone 7 และ 8
สอน iOS การเขียนโปรแกรม iPhone, iPad
สอน Java การเขียนโปรแกรม ภาษา Java
สอน Java GUI การเขียนโปรแกรม ภาษา Java GUI
สอน JSP การเขียนโปรแกรม ภาษา Java
สอน jQuery การเขียนโปรแกรม ภาษา jQuery
สอน .Net การเขียนโปรแกรม ภาษา .Net
Free Tutorial
สอน Google Maps Api
สอน Windows Service
สอน Entity Framework
สอน Android
สอน Java เขียน Java
Java GUI Swing
สอน JSP (Web App)
iOS (iPhone,iPad)
Windows Phone
Windows Azure
Windows Store
Laravel Framework
Yii PHP Framework
สอน jQuery
สอน jQuery กับ Ajax
สอน PHP OOP (Vdo)
Ajax Tutorials
SQL Tutorials
สอน SQL (Part 2)
JavaScript Tutorial
Javascript Tips
VBScript Tutorial
VBScript Validation
Microsoft Access
MySQL Tutorials
-- Stored Procedure
MariaDB Database
SQL Server Tutorial
SQL Server 2005
SQL Server 2008
SQL Server 2012
-- Stored Procedure
Oracle Database
-- Stored Procedure
SVN (Subversion)
แนวทางการทำ SEO
ปรับแต่งเว็บให้โหลดเร็ว


Hit Link
   







Load balance : Server 00
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่