sql脚本的一个用法&怎样结合script脚本的例子

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>农信通查询</title>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
<link href="format.css" rel="stylesheet" type="text/css">
</head>
<script language="javascript">
function canceluser(id)
{
if(confirm("确认?"))
{
 location.href="?op=DelUser&Phone=<%=Request("Phone")%>&id="+id
}
 //alert(id)
}
</script>

<%
if "" & request("Phone") <>"" then
 if Request("op")="DelUser" then
  'Delete user
  conn.execute "update t_common_active_user set Status='1',UnRegTime='" & now & "' where id="  &Requestint("id")
 end if
 response.write "订购关系:<br>"
 dim sql
 'ID Phone FeePhone RegTime Status ServiceName LastFeeMonth FirstFeeTime RegTimes UnRegTime FirstMonth AddMethed
 sql="select phone as 手机号码,RegTime as 订制时间,chinesename as 业务名称,CASE Status WHEN 0 THEN '正常用户' WHEN 1 THEN '已退订' END as 是否计费,UnRegTime as 取消时间,CASE LastFeeMonth WHEN 0 THEN '尚未计费' ELSE 'cast(LastFeeMonth as varchar(2))+月' end as 最后计费月份,'<a href=# οnclick=""canceluser(' + cast(a.id as varchar(20)) + ')"">取消</a>' as 操作 from t_common_active_user a join t_common_service b on a.servicename=b.servicename    where extnumber like '09896%' and  a.Phone = '" & requestex("Phone") & "'"
 PrintRS_12580 conn.execute(sql)
end if

function PrintRS_12580(rs)
 dim vcolcolor,vtabletitlebackcolor,vtablebordercolor
 vcolcolor="#ffffff"
 vtabletitlebackcolor="#f0f0f0"
 vtablebordercolor="#e0e0e0"
 
 if  Typename(rs)<>"Recordset" then
  
  response.write "本次操作无结果集"

 end if

  response.write "<table  cellspacing='1' cellpadding='0' border=0  bgcolor='" & vtablebordercolor &"'>"
  Response.write("<TR height=25 bgcolor='" & vcolcolor & "' >")
  'For i=1 to rs.Fields.count
    'Response.write("<TD  height=25  bgcolor='" & Session("vtabletitlebackcolor") & "' >" & rs.Fields(i-1).type  & "</TD>")
  'Next
     
  'Response.write("</tr><TR height=25 bgcolor='" & Session("vcolcolor") & "' >")

  For i=1 to rs.Fields.count
    Response.write("<TD  height=25  bgcolor='" & vtabletitlebackcolor & "' >" & rs.Fields(i-1).name  & "</TD>")
  Next
  
  'Response.write("</tr><TR height=25 bgcolor='" & Session("vcolcolor") & "' >")

  'For i=1 to rs.Fields.count
    'Response.write("<TD  height=25  bgcolor='" & Session("vtabletitlebackcolor") & "' >" & rs.Fields(i-1).DefinedSize   & "</TD>")
  'Next
 
 
 
  Do While Not rs.EOF
    '///行开输出始///
   Response.write("</tr><TR height=25 bgcolor='" & vcolcolor & "' >")
 
   '遍历每一个字段
   For i = 0 to rs.Fields.count-1
       
       Response.Write("<TD>" &   rs.Fields(i).value  & "&nbsp; </TD>")
       
      
   Next
   Response.Write("</Tr>")
   Response.Flush()

   rs.MoveNext
  Loop
 'end if
  response.write "</table><br><br>"
 set rs2=rs.nextrecordset
 if not rs2 is nothing then
  PrintRS rs2
 end if
end function

%>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值