已用<!-- #include file="conn/conn.asp" -->连接数据库了
<%DimConn,Rs,sql,dingdanztdingdanzt=""sql="select*fromweowherebianhao='"&request("bia...
<%
Dim Conn, Rs, sql, dingdanzt
dingdanzt = ""
sql="select * from weo where bianhao='" & request("bianhao") & "'"
set conn=server.createobject("adodb.connection")
mypath=server.mappath("data/1.mdb")
conn.open "provider=microsoft.jet.oledb.4.0;data source=" & mypath
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open Sql, Conn, 1,1
If Not(Rs.Eof) Then
dingdanzt = Rs("dingdanzt") '假设dingdanzt是你表中的字段名
End If
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
If dingdanzt<>"" Then%>
<script language="javascript">
alert("该订单已无法修改!")
window.location.href="../index.asp"
</script><%
response.end
End If
%>
已连接数据库了
<!-- #include file="conn/conn.asp" -->
上面那段代码如何改
这么写不行吗
<%
sql="select * from weo where bianhao="&request("bianhao")
If dingdanzt<>"" Then
%>
<script language="javascript">
document.write('该订单已无法修改了!')
</script>
<%
response.end
End If
%> 展开
Dim Conn, Rs, sql, dingdanzt
dingdanzt = ""
sql="select * from weo where bianhao='" & request("bianhao") & "'"
set conn=server.createobject("adodb.connection")
mypath=server.mappath("data/1.mdb")
conn.open "provider=microsoft.jet.oledb.4.0;data source=" & mypath
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open Sql, Conn, 1,1
If Not(Rs.Eof) Then
dingdanzt = Rs("dingdanzt") '假设dingdanzt是你表中的字段名
End If
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
If dingdanzt<>"" Then%>
<script language="javascript">
alert("该订单已无法修改!")
window.location.href="../index.asp"
</script><%
response.end
End If
%>
已连接数据库了
<!-- #include file="conn/conn.asp" -->
上面那段代码如何改
这么写不行吗
<%
sql="select * from weo where bianhao="&request("bianhao")
If dingdanzt<>"" Then
%>
<script language="javascript">
document.write('该订单已无法修改了!')
</script>
<%
response.end
End If
%> 展开
3个回答
展开全部
你的基础太弱了,这些都是非常基础的东西.
<!-- #include file="conn/conn.asp" -->
<%
Dim Rs, sql, dingdanzt
dingdanzt = ""
If IsNumeric(request("bianhao")) Then
sql = "select * from weo where bianhao=" & request("bianhao")
Else
Response.Write "参数bianhao无效!" : Response.End
End If
Rs.Open Sql, Conn, 1,1
If Not(Rs.Eof) Then
dingdanzt = Rs("dingdanzt")
End If
Rs.Close
Set Rs = Nothing
If dingdanzt<>"" Then%>
<script language="javascript">
alert("该订单已无法修改!")
window.location.href="../index.asp"
</script><%
response.end
End If
%>
<!-- #include file="conn/conn.asp" -->
<%
Dim Rs, sql, dingdanzt
dingdanzt = ""
If IsNumeric(request("bianhao")) Then
sql = "select * from weo where bianhao=" & request("bianhao")
Else
Response.Write "参数bianhao无效!" : Response.End
End If
Rs.Open Sql, Conn, 1,1
If Not(Rs.Eof) Then
dingdanzt = Rs("dingdanzt")
End If
Rs.Close
Set Rs = Nothing
If dingdanzt<>"" Then%>
<script language="javascript">
alert("该订单已无法修改!")
window.location.href="../index.asp"
</script><%
response.end
End If
%>
来自:求助得到的回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询