xXchienthanXx
Mr & Ms Pac-Man
- 17/11/06
- 129
- 0
bạn nào cho mình hỏi cách phân trang sau khi tìm kiếm trong CSDL với
code mình :
_______________
<%
Set prodRS=Server.CreateObject("ADODB.Recordset")
prodRS.Activeconnection= con
prodRS.CursorType=adOpenStatic
prodRS.PageSize=8
sql = "select * from Bai_Gui_Binh_Luan where Noi_Dung_Bai_Viet LIKE '%" & TuKhoa & "%'"
set prodRS=con.execute(sql)
'prodRS.AbsolutePage=pg 'Cái này để phân trang mà nó báo lỗi.
'nếu "set prodRS=con.execute(sql)" mà thành 'prodRS.Open sqlString' thì có lẽ phân trang được. nhưng mình hem bít ::(%>
<%if prodRS.eof then%>
ten nay ko ton tai hoac ko co trong CSDL !
<% else %> <P>
<b> KET QUA TIM KIEM<hr></b>
<%WHILE NOT prodRS.EOF%>
response.Write(prodRS("Ten_Bai_Viet"))
prodRS.MoveNext
WEND
end if %>
__________
vấn đề là thế. ai bít chỉ giúp mình. thanks :whew:
code mình :
_______________
<%
Set prodRS=Server.CreateObject("ADODB.Recordset")
prodRS.Activeconnection= con
prodRS.CursorType=adOpenStatic
prodRS.PageSize=8
sql = "select * from Bai_Gui_Binh_Luan where Noi_Dung_Bai_Viet LIKE '%" & TuKhoa & "%'"
set prodRS=con.execute(sql)
'prodRS.AbsolutePage=pg 'Cái này để phân trang mà nó báo lỗi.
'nếu "set prodRS=con.execute(sql)" mà thành 'prodRS.Open sqlString' thì có lẽ phân trang được. nhưng mình hem bít ::(%>
<%if prodRS.eof then%>
ten nay ko ton tai hoac ko co trong CSDL !
<% else %> <P>
<b> KET QUA TIM KIEM<hr></b>
<%WHILE NOT prodRS.EOF%>
response.Write(prodRS("Ten_Bai_Viet"))
prodRS.MoveNext
WEND
end if %>
__________
vấn đề là thế. ai bít chỉ giúp mình. thanks :whew: