-
ASP DBHelper 추가사항Web Program/ASP/PHP/JSP 2008. 5. 23. 02:07
흠..taeyo사이트의 안재우님이 만들어주신 DBHelper를 잘 사용하고 있다가..
몇가지 추가할부분이 생겨서...개인적으로 안재우님 소스는 건들지 않고..
추가적으로 내소스를 수정하였다...흠..
'###################################################################
'수정일: 2008.4.20
'클래스지정용도: 페이징클래스 병합
'작성자:서영식
'###################################################################
public Function beforePage(imgFullName,strGetString)
if currentPageNo > intPageSize then
writePage = "<a href='"& thisPageName &"?pageNo="& intPageEnd & strGetString &"'> <img src='" & imgFullName &"' align='absmiddle'> </a>"
else
writePage = " <img src='" & imgFullName &"' align='absmiddle'> "
end if
beforePage = writePage
End Functionpublic Function afterPage(imgFullName,strGetString)
if (intPageEnd + (intPageSize + 1)) <= intPageCount then
afterPage = "<a href='"& thisPageName &"?pageNo="& intPageEnd + (intPageSize + 1) & strGetString &"'> <img src='" & imgFullName &"' align='absmiddle'> </a>"
else
afterPage = " <img src='" & imgFullName &"' align='absmiddle'> "
end if
End Functionpublic Function pageList(writeList,startHTML,endHTML,startThisHTML,endThisHTML,strGetString)
pageGroupNum = intPageSize
startPageNumber = intPageEnd + 1
writePage = ""
if writeList = 0 then
if currentPageNo > 1 then
writePage = " <a href='"& thisPageName &"?pageNo="& startPageNumber & strGetString &"'>"& startHTML & startPageNumber & endHTML &"</a>"
else
writePage = " "& startThisHTML & startPageNumber & endThisHTML &" "
end if
Else
Do While (pageGroupNum > 0) and (startPageNumber <= intPageCount)
if currentPageNo = startPageNumber Then
writePage = writePage & " <b> "& startThisHTML & startPageNumber & endThisHTML &" </b> "
Else
writePage = writePage & " <a href='"& thisPageName &"?pageNo="& startPageNumber & strGetString &"'>"& startHTML & startPageNumber & endHTML &"</a> "
end if
pageGroupNum = pageGroupNum - 1
startPageNumber = startPageNumber + 1
Loop
end if
pageList = writePage
End Functionpublic Function firstPage(imgFullName,strGetString)
if currentPageNo > 10 then
firstPage = "<a href='"& thisPageName &"?pageNo=1"& strGetString &"'><img src='"& imgFullName &"' border='0' align='absmiddle'></a>"
else
firstPage = "<img src='"& imgFullName &"' align='absmiddle'>"
end if
End Functionpublic Function lastPage(imgFullName,strGetString)
if intPageCount > 10 and intPageCount > currentPageNo then
lastPage = "<a href='"& thisPageName &"?pageNo="& intPageCount & strGetString &"'><img src='"& imgFullName &"' border='0' align='absmiddle'></a>"
else
lastPage = "<img src='"& imgFullName &"' align='absmiddle'>"
end if
End Function
'###################################################################
'수정일: 2008.4.20
'클래스지정용도: getRows 생성
'작성자:서영식
'###################################################################
public Function Returngetrows(fnc_query)
Set Rs = ExecSQLReturnRS(fnc_query,Nothing,Nothing)if not(Rs.bof or Rs.eof) then
ArrGetRows = Rs.getRows()
end ifRs.Close
Set Rs = Nothingif isArray(ArrgetRows) then
Returngetrows = ArrGetRows
else
Returngetrows = null
end if
End function
'###################################################################
'수정일: 2008.4.20
'클래스지정용도: 글의 합계와 페이지를 위해 넘겨줌
'작성자:서영식
'###################################################################
public Function totalquery(fnc_idx,fnc_tableName,fnc_where,fnc_count)
query = "Select count(" & fnc_idx &"),CEILING(CAST(count(" & fnc_idx &") as Float)/" & fnc_count & ") from " & fnc_tableName & fnc_where
Set Rs = ExecSQLReturnRs(query,Nothing,Nothing)If Not(Rs.Bof Or Rs.Eof) Then
total_Count = Rs(0)
totalpage_Count = Rs(1)
Else
total_Count = 0
totalpage_Count = 0
End IfDim arrCount(1)
arrCount(0) = total_Count
arrCount(1) = totalpage_Counttotalquery = arrCount
End Function
'###################################################################
'수정일: 2008.4.20
'클래스지정용도:
'작성자:서영식
'###################################################################
public Function columnsApply(fnc_tableName,k,fnc_array)
query = "sp_columns " & fnc_tableName
Set Rs = ExecSQLReturnRs(query,Nothing,Nothing)if not(Rs.Bof or Rs.EOf) then
columnsgetRows = Rs.getRows()
end ifRs.Close
Set Rs = Nothing
End Function
'###################################################################'Web Program > ASP/PHP/JSP' 카테고리의 다른 글
php[날짜 추가시] (0) 2009.01.05 PHP 파일업로드 iconv (0) 2008.11.13 Dictionary 객체 (0) 2008.07.13 sql_injection 정리 (0) 2008.05.23 ..ASP Class를 만드는 방법 (0) 2008.03.26