📄 function2.asp
字号:
dim strSuccess
strSuccess=strSuccess & "<html><head><title>成功信息</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbcrlf
strSuccess=strSuccess & "<link href='style.css' rel='stylesheet' type='text/css'></head><body>" & vbcrlf
strSuccess=strSuccess & "<table cellpadding=2 cellspacing=2 border=0 width=400 class='border' align=center>" & vbcrlf
strSuccess=strSuccess & " <tr align='center'><td height='20' class='title'><strong>恭喜你!</strong></td></tr>" & vbcrlf
strSuccess=strSuccess & " <tr><td height='100' class='tdbg' valign='top'><br>" & SuccessMsg &"</td></tr>" & vbcrlf
strSuccess=strSuccess & " <tr align='center'><td class='title'><a href='javascript:history.go(-1)'>【返回】</a></td></tr>" & vbcrlf
strSuccess=strSuccess & "</table>" & vbcrlf
strSuccess=strSuccess & "</body></html>" & vbcrlf
response.write strSuccess
end sub
'****************************************************
'过程名:getValueByValue
'作 用:根据一个条件字段的值,获得数据库库中某个目标字段的值
'参 数:sTarget目标字段,
' sTable数据库表名,
' sIndex条件字段,
' sValue条件字段的值
'返回值:目标字段的值
'****************************************************
function getValueByValue(sTarget,sTable,sIndex,sValue,SQLstr)'---该函数测试通过了
' dim conn,strcn
dim sqltext,conn77
Set conn77=server.createobject("adodb.connection")
conn77.open SQLstr'Access
set rs4477=server.createobject("adodb.recordset")
sqltext="select "&sTarget&" from "&sTable&" Where "&sIndex&" like '"&sValue&"'"
rs4477.open sqltext,conn77,1,1
if not rs4477.eof then
getValueByValue=rs4477.Fields(0).value
else
getValueByValue="*"
end if
rs4477.Close
Set rs4477 = Nothing
conn77.close
set conn77=nothing
end function
'****************************************************
'过程名:lineDelete
'作 用:删除数据库表中,满足条件字段的记录
'参 数:sTable数据库表名,
' sIndex条件字段,
' sValue条件字段的值
'返回值:无
'****************************************************
sub lineDelete(sTable,sIndex,sIndexVal,SQLstr)'该DEL函数测试通过了
Dim sql1,conn31
Set conn31=server.createobject("adodb.connection")
conn31.open SQLstr'Access
sql1="delete from "&sTable
sql1=sql1&" where "&sIndex
sql1=sql1&" like '"&sIndexVal&"'"
'response.write(sql1)
conn31.execute(sql1)
conn31.close
set conn31=nothing
end sub
'****************************************************
'过程名:Modify
'作 用:修改数据库表中,满足条件字段的记录的目标字段的值
'参 数:sTable数据库表名,
' sField 目标字段
' sValue目标字段的值
' sIndex条件字段,
' sIndexValue条件字段的值
'返回值:无
'****************************************************
Sub Modify(sTable,sField,sValue,sIndex,sIndexValue,SQLstr)'该函数测试通过了
Dim sql,conn3
Set conn3=server.createobject("adodb.connection")
conn3.open SQLstr'Access
sql="update "&sTable
sql=sql&" set "&sField
sql=sql&"='"&sValue&"'"
sql=sql&" where "&sIndex
sql=sql&" like '"&sIndexValue&"'"
conn3.execute(sql)
conn3.close
set conn3=nothing
End Sub
'****************************************************
'过程名:SearchRecorder
'作 用:寻找相临的数据(sIndex字段)
'参 数:sSQL标准SQL,
' sPage 位置--0代表上面一个位置,1---代表下面一个位置
' sIndex条件字段,
' sIndexValue条件字段的值
'返回值:相邻数据记录号,NULL为#
'****************************************************
Function SearchRecorder(sSQL,sPage,sIndex,sIndexValue,SQLstr)'该函数测试通过了
dim result
Dim conn3
Dim rsRec
'response.write(sIndexValue)
result="#"
Set conn3=server.createobject("adodb.connection")
conn3.open SQLstr'Access
set rsRec=server.createobject("adodb.recordset")
'response.write(sSQL)
rsRec.open sSQL,conn3,1,1
Do while not rsRec.EOF
if Cstr(rsRec(Cstr(sIndex)))=Cstr(sIndexValue) then
if sPage="0" then
rsRec.MovePrevious
if not rsRec.BOF then
result=rsRec(Cstr(sIndex))
else
result="#"
end if
exit do
elseif sPage="1" then
rsRec.MoveNext
if not rsRec.EOF then
result=rsRec(Cstr(sIndex))
else
result="#"
end if
exit do
end if
end if
rsRec.MoveNext
loop
rsRec.close
set rsRec=nothing
conn3.close
set conn3=nothing
SearchRecorder=result
End Function
'****************************************************
'过程名:SearchRecorder2
'作 用:寻找相临的数据(sIndex字段)
'参 数:sSQL标准SQL,
' sPage 位置--0代表上面一个位置,1---代表下面一个位置
' sIndex条件字段,
' sIndexValue条件字段的值
'返回值:相邻数据记录号,NULL为#
'****************************************************
Function SearchRecorder2(sSQL,sPage,sIndex,sIndexValue,SQLstr)'该函数测试通过了
dim result
Dim conn3
Dim rsRec
'response.write(sIndexValue)
result="#"
Set conn3=server.createobject("adodb.connection")
conn3.open SQLstr'Access
set rsRec=server.createobject("adodb.recordset")
'response.write(sSQL)
rsRec.open sSQL,conn3,1,1
Do while not rsRec.EOF
if Cstr(rsRec(Cstr(sIndex)))=Cstr(sIndexValue) then
if sPage="0" then
rsRec.MovePrevious
if not rsRec.BOF then
result=rsRec(Cstr(sIndex))
else
result="#"
end if
exit do
elseif sPage="1" then
rsRec.MoveNext
if not rsRec.EOF then
result=rsRec(Cstr(sIndex))
else
result="#"
end if
exit do
end if
end if
rsRec.MoveNext
loop
rsRec.close
set rsRec=nothing
conn3.close
set conn3=nothing
SearchRecorder2=result
End Function
%>
<% Sub MsgTime(Error,url,time)%>
<HTML><HEAD><TITLE>提示</TITLE>
<%
if time="" then
time=0.5
end if
%>
<META charset=gb2312 content="Microsoft FrontPage 4.0" name=GENERATOR>
<meta http-equiv=refresh content="<%=time%>;url=<%=url%>"><STYLE type=text/css>.main {
FONT-SIZE: 12px
}
.main1 {
FONT-SIZE: 14px
}
.main2 {
FONT-SIZE: 16px
}
.main3 {
FONT-SIZE: 7px
}
.main4 {
FONT-SIZE: 10px
}
A:link {
COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
COLOR: #000000; TEXT-DECORATION: none
}
A:active {
COLOR: #ff0000; TEXT-DECORATION: none
}
A:hover {
COLOR: #aa0000; TEXT-DECORATION: underline
}
</STYLE>
</HEAD>
<BODY bgColor=#ffffff class=clblue leftMargin=0 topMargin=2 marginwidth="0"
marginheight="0"><BR><BR><BR><BR>
<P><BR>
<CENTER>
<P align=center><BR>
<TABLE cellPadding=0 cellSpacing=0 width=230>
<TBODY>
<TR>
<TD align=middle>
<TABLE bgColor=#1f60a0 cellPadding=0 cellSpacing=0 width=308>
<TBODY>
<TR>
<TD height=2 width=113>
<P align=center> </P></TD>
<TD height=2 width=191>
<DIV align=right></DIV></TD></TR></TBODY></TABLE>
<DIV align=center>
<CENTER>
<TABLE bgColor=#416327 cellPadding=4 cellSpacing=1 height=100 width=306>
<TBODY>
<TR bgColor=#e1f0ff vAlign=top>
<TD class=main1 height=53 width=292>
<P align=center><BR><% response.write Error%></P></TD></TR>
<TR bgColor=#e1f0ff>
<TD class=main1 height=27 width=292>
<DIV align=center><a href="<%=url%>">返回</a>
</DIV></TD></TR></TBODY></TABLE></CENTER></DIV>
<TABLE bgColor=#1f60a0 cellPadding=0 cellSpacing=0 width=307>
<TBODY>
<TR>
<TD height=2 width=119></TD>
<TD height=2 width=206>
<DIV align=right></DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<P align=center><BR></P>
<DIV align=center class=main1></DIV></CENTER>
<P><BR></P></BODY></HTML>
<%End Sub%>
<%
'****************************************************
'过程名:getValueByValue2
'作 用:根据一个条件字段的值,获得数据库库中某个目标字段的值
'参 数:sTarget目标字段,
' sTable数据库表名,
' sIndex条件字段,
' sValue条件字段的值
'返回值:目标字段的值
'****************************************************
function getValueByValue2(sTarget,sTable,sIndex,sValue,SQLstr)'---该函数测试通过了
' dim conn,strcn
dim sqltext,conn77
Set conn77=server.createobject("adodb.connection")
conn77.open SQLstr'MSSQL
set rs4477=server.createobject("adodb.recordset")
sqltext="select "&sTarget&" from "&sTable&" Where "&sIndex&" like '"&sValue&"'"
rs4477.open sqltext,conn77,1,1
if not rs4477.eof then
getValueByValue2=rs4477.Fields(0).value
else
getValueByValue2="*"
end if
rs4477.Close
Set rs4477 = Nothing
conn77.close
set conn77=nothing
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -