Makanya pake ASP.NET aja. Cuma klak-klik doank buat bikin DataGrid + coding
cm 4 baris dah bisa bikin nampilin isi DB per halaman :)

Btw, Ogie makin jadi aja nich :)


Andrayogi
IT Development Team | PT. Faasri Utama Sakti
There's so many things i have to learn...
http://www.andrastudio.com 
 
 
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of madfriedrich
Sent: Friday, November 25, 2005 9:22 PM
To: [email protected]
Subject: Re: [MasterWeb] tampilin database perpage gimana yah?

untuk asp malah lebih mudah, karena hanya menggunakan 1 query saja. 
codingnya kira2 seperti dibawah (maaf kalau ada error, codingnya 
belum di debug :))

<%
const_rec_per_page = 20
page = trim(request.querystring("page"))

set conn = Server.CreateObject("ADODB.Connection")
conn.open "PROVIDER=SQLOLEDB;DATA 
SOURCE=sqlservername;UID=username;PWD=password;DATABASE=mydatabasename

set rs = server.createobject("ADODB.Recordset")
sql = "SELECT * FROM nama_table"
rs.open sql, conn, 1, 3

const_total_rec = rs.recordcount

if (const_total_rec mod const_rec_per_page = 0) then
        const_total_page = cint(const_total_rec / const_total_page)
else
        const_total_page = cint((const_total_rec / const_total_page) 
+ 1)
end if

if (isnumeric(page)) then
        const_start_rec = cint((page - 1) * const_rec_per_page)
else
        const_total_rec = 0
end if

rs.move const_total_rec

do while(not rs.eof)
        const_total_rec = const_total_rec + 1
        response.write(rs("nama_field"))
        if (const_total_rec mod const_rec_per_page = 0) then
                exit do
        end if
        rs.movenext
loop

if (const_total_page > 0) then
        for i = 1 to const_total_page
                if (cint(i) = cint(page)) then
                        response.write("<b>" & i & "</b> ")
                else
                        response.write("<a href=""nama_page.asp?
page=" & i & """>" & i & "</a> ")
                end if
        next
end if

rs.close
set rs = nothing

conn.close
set conn = nothing
%>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/IHFolB/TM
--------------------------------------------------------------------~-> 

----------------------------------------------------------
Komunitas MasterWeb Indonesia http://www.master.web.id
----------------------------------------------------------
MWN, Masternya WEBHOSTING di Indonesia, Indo/USA Servers,
Customer Support 24 jam  http://www.masterwebnet.com
----------------------------------------------------------
WebDevelopment,Designing/Programming http://www.dlanet.com
---------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/milis-masterweb/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Kirim email ke