我想把上面数据库的记录显示中心对齐,这是个ASP方面的代码。请问怎么作呀。谢谢
<%@ codepage=936%>
<%Option Explicit%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<Title>TPI</Title>
<!-- #include file="../share/BaseConfig.asp" -->
<!-- #include file="../function/S_CommonError.asp" -->
<!-- #include file="../function/S_Get_RecordSet.asp" -->
<!-- #include file="../function/S_Return_HomePage.asp" -->
<!-- #include file="../function/S_Check_Login_Info.asp" -->
<!-- #include file="../function/S_Get_Tpi40RecordSet.asp" -->
<!-- #include file="../function/S_TPI_CopyRight.asp" -->
<!-- #include file="../function/S_CreateAdodb_Conn.asp" -->
<!-- #include file="../function/S_Check_Web_Release.asp" -->
<!-- #include file="../function/S_Close_RecordSet.asp" -->
<!-- #include file="../function/S_Close_Connection.asp" -->
<!-- #include file="Function.asp" -->
<%
'参数说明:
'ConnNumber 登录连接后的权限标志
'S_databasename 数据库名字
'Pagesize 每页显示条数
dim szUserName
dim szPassWord
dim hConn
szUserName = session("szUserName")
szPassWord = session("szPassWord")
Set hConn = S_Check_Login_Info(szHostIP , szUserName ,szPassWord ,"0")
'取得每页显示多少条
dim nPageSize
nPageSize = Trim(request("RowPerPage"))
if nPageSize = "" then
nPageSize = session("nPageSize")
else
session("nPageSize") = nPageSize
end if
dim szSearch
if len(trim(Request.Form("field1"))) <> 0 then
szSearch = "基本检索"
elseif len(trim(Request.Form("secondfield"))) <> 0 then
szSearch = "基本二次检索"
else
szSearch = "翻页检索"
end if
dim szField
dim szValue
dim szSelectBox
dim szOrder
dim szCondition
dim szLibValue
dim szSql
dim arrLibValue
dim szSql1
dim arrLibValue1
dim Conn
dim Rs
dim DatabaseName
dim szErrorCode
dim szLibValue2
dim i
if szSearch = "基本检索" then
szField = trim(Request.Form("field1"))
szValue = trim(Request.Form("value1"))
szSelectBox = trim(Request.Form("selectbox"))
szOrder = trim(Request.Form("order"))
szCondition = ""
szLibValue = ""
szSql = "select * from " & szSelectBox & " where "
szSql = S_Check_Web_Release( szSql , hConn ) '加上检索状态
'如果输入了条件
if len(trim(szValue)) <> 0 then
'读取以前配置的信息
DatabaseName = "../config/moredatabase.mdb"
call S_CreateAdodb_Conn( DatabaseName , Conn , Rs)
szSql1 = "select * from me where field = '" & szField & "'"
Rs.Open szSql1 , Conn , 1 , 1
if not Rs.EOF then
arrLibValue = split(Rs("value"),",")
szLibValue = Rs("value")
end if
Rs.Close()
call S_CloseAdodb_Conn( Conn , Rs )
for i = 0 to ubound( arrLibValue )
if arrLibValue(i) <> "" then
arrLibValue1 = split(arrLibValue(i),".")
if Instr(szSelectBox,arrLibValue1(0)) > 0 and Instr(szLibValue,arrLibValue1(0)) > 0 then
szCondition = szCondition + " or (" + arrLibValue(i) + "='" + szValue + "')"
szLibValue2 = szLibValue2 + "," + arrLibValue1(0)
end if
end if
next
if left(szLibValue2,1) = "," then
szLibValue2 = right(szLibValue2,len(szLibValue2) - 1)
end if
szSql = "select * from " & szLibValue2 & " where "
szCondition = trim( szCondition )
if szCondition = "" then
szErrorCode = "对不起,没有检索到记录!"
call S_CommonError(szErrorCode , Request.ServerVariables("PATH_INFO"),"", "0")
end if
if left(szCondition,2) = "or" then
szCondition = Right(szCondition,len(szCondition) - 2)
end if
szSql = szSql + "(" + szCondition + ")"
end if
if szOrder <> "" then
szSql = szSql &" order by " & szOrder
end if
end if
dim szSecondField
dim szSecondValue
dim szTitle
dim nOrderPos
dim szRightSql
if szSearch = "基本二次检索" then
szSecondField = trim(Request.Form("secondfield"))
szSecondValue = trim(Request.Form("secondvalue"))
szTitle = trim(Request.Form("title"))
szSql = trim(Request("sql"))
nOrderPos = Instr(szSql,"order")
if nOrderPos > 1 then
szRightSql = Right(szSql,len(szSql) - nOrderPos + 1)
szSql = Left(szSql,nOrderPos - 1)
end if
'读取以前配置的信息
DatabaseName = "../config/moredatabase.mdb"
call S_CreateAdodb_Conn( DatabaseName , Conn , Rs)
szSql1 = "select * from me where field = '" & szSecondField & "'"
Rs.Open szSql1 , Conn , 1 , 1
if not Rs.EOF then
arrLibValue = split(Rs("value"),",")
szLibValue = Rs("value")
end if
Rs.Close()
call S_CloseAdodb_Conn( Conn , Rs )
for i = 0 to ubound(arrLibValue)
if arrLibValue(i) <> "" then
arrLibValue1 = split(arrLibValue(i),".")
if Instr(szLibValue,arrLibValue1(0)) > 0 then
szCondition = szCondition +" or ("+ arrLibValue(i) + "='" + szSecondValue + "')"
end if
end if
next
szCondition = trim(szCondition)
if left(szCondition,2) = "or" then
szCondition = right(szCondition,len(szCondition) - 2)
end if
if len(trim(szSecondValue)) <> 0 then
szSql = TRIM(szSql)
if szSecondValue <> "" then
if lcase(right(szSql,5)) = "where" then
szSql = szSql & " (" & szCondition & ")"
else
szSql = szSql & " and (" & szCondition & ")"
end if
end if
end if
szSql = szSql & " " & szRightSql
szSql = trim( szSql )
end if
dim nPage
if szSearch = "翻页检索" then
nPage = Request("Page")
szSql = Request("Sql")
end if
if request("page") = "" or IsNumeric(request("page")) = false then
nPage = 1
Else
nPage = Request("Page")
End If
szSql = trim(szSql)
dim szReturntoEveryTemplateSql
szReturntoEveryTemplateSQL = szSql
'Response.write szSql
'Response.end
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<Title>敦煌信息资源数据库</Title>
</head>
<BODY leftMargin=0 topMargin=0 rightMargin=0 >
<form method="post" action="../share/ReturnToEveryTemplate.asp" name="Template" target="_blank">
<table id="table1" border="0" cellpadding="0" cellspacing="0" width="200"> <tr><td colspan="3">
<input type="hidden" value="" name="sysid">
<input type="hidden" value="" name="databasename">
<input type="hidden" value="" name="CurrentNum">
</td></tr>
<tr>
<td>
</td>
</tr>
</table>
</form>
</body>
<script language="javascript">
function toTemplate( sysid , databasename ,CurrentNum )
{
document.Template.sysid.value = sysid;
document.Template.databasename.value = databasename;
document.Template.CurrentNum.value = CurrentNum;
document.Template.submit();
}
</script>
<%
'sql="select * from TPI40 where (TPI40.作者=赵祥云)"
call ReadRecord( nPageSize , nPage , szSql , szReturntoEveryTemplateSQL , hConn ) '函数调用
call S_Close_Connection( hConn )
%>
==============
1.
问题:
我想把上面数据库的记录显示中心对齐,这是个ASP方面的代码。请问怎么作呀。谢谢
2.
我的思维就是在ASP代码中签入TABLE
如下所示:
<%
img=" http://www.baidu.com/img/logo-yy.gif"
response.write "<table border=0 width=200>"
response.write "<tr><td><img border=0 src="&img&"></td></tr>"
response.write "<tr><td><img border=0 src="&img&"></td></tr>"
response.write "</table>"
%>