请问ASP 怎么把变量传到ACCESS???
我的代码简略的如下student是表名name2是要传递的字段名变量名也是name2<!--#includefile="conn.asp"--><linkhref="cs...
我的代码简略的如下 student是表名 name2 是要 传递的字段名 变量名也是name2
<!--#include file="conn.asp" -->
<link href="css/css.css" rel="stylesheet" type="text/css">
<title>人员详细信息</title>
<%
set rsstudent=server.createobject("adodb.recordset")
sqlstudent="select * from student where adid="&adid
rsstudent.open sqlstudent,conn,1,1
%>
<% name2 = year(now())-year(rsstudent("student2") ) %>
我想把这个name2传递到student内的NAME2里去。。请问怎么做,我试了好久都出错
后面是全部代码<!--#include file="conn.asp" -->
<% if session("adminname") = "" or session("adminpassword") = "" then %>
<script>alert('你还没有登录呢');history.back();</script>
<% else %>
<%
set rswebsite=server.createobject("adodb.recordset")
sqlwebsite = "select *,web_id from website "
rswebsite.open sqlwebsite,conn,1,1
%>
<link href="css/css.css" rel="stylesheet" type="text/css">
<title>人员详细信息</title>
<%
yzzh=session("adminname")
set rslx_admin=server.createobject("adodb.recordset")
sqllx_admin = "select lx_power from lx_admin where lx_username ='"&yzzh&"' "
rslx_admin.open sqllx_admin,conn,1,1
dengji = rslx_admin("lx_power")
adid=request("adid")
session("com_classname")=adid
set rschange=server.createobject("adodb.recordset")
sqlchange="select * from change where adid='"&adid&"' "
rschange.open sqlchange,conn,1,1
set rsGraduation=server.createobject("adodb.recordset")
sqlGraduation="select * from Graduation where adid='"&adid&"' "
rsGraduation.open sqlGraduation,conn,1,1
set rsstudent=server.createobject("adodb.recordset")
sqlstudent="select * from student where adid="&adid
rsstudent.open sqlstudent,conn,1,1
session("status_numberok")=rsstudent("status_number")
set rsScore=server.createobject("adodb.recordset")
sqlScore="select * from Score where status_number='"&session("status_numberok")&"' "
rsScore.open sqlScore,conn,1,1
session("del_student")=adid
if rsstudent.eof and rsstudent.bof then
response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 抱歉暂时没有数据!');window.location.href='admin_head.asp';</script>"
else
set rspl=server.createobject("adodb.recordset")
sqlpl = "select * from comment where com_classname = "&session("com_classname")&" order by com_id desc"
rspl.open sqlpl,conn,1,1
if dengji = 1 then
%>
<% name2 = year(now())-year(rsstudent("student2") ) %>
好像也不行。。能不能给我个完整的??谢谢 展开
<!--#include file="conn.asp" -->
<link href="css/css.css" rel="stylesheet" type="text/css">
<title>人员详细信息</title>
<%
set rsstudent=server.createobject("adodb.recordset")
sqlstudent="select * from student where adid="&adid
rsstudent.open sqlstudent,conn,1,1
%>
<% name2 = year(now())-year(rsstudent("student2") ) %>
我想把这个name2传递到student内的NAME2里去。。请问怎么做,我试了好久都出错
后面是全部代码<!--#include file="conn.asp" -->
<% if session("adminname") = "" or session("adminpassword") = "" then %>
<script>alert('你还没有登录呢');history.back();</script>
<% else %>
<%
set rswebsite=server.createobject("adodb.recordset")
sqlwebsite = "select *,web_id from website "
rswebsite.open sqlwebsite,conn,1,1
%>
<link href="css/css.css" rel="stylesheet" type="text/css">
<title>人员详细信息</title>
<%
yzzh=session("adminname")
set rslx_admin=server.createobject("adodb.recordset")
sqllx_admin = "select lx_power from lx_admin where lx_username ='"&yzzh&"' "
rslx_admin.open sqllx_admin,conn,1,1
dengji = rslx_admin("lx_power")
adid=request("adid")
session("com_classname")=adid
set rschange=server.createobject("adodb.recordset")
sqlchange="select * from change where adid='"&adid&"' "
rschange.open sqlchange,conn,1,1
set rsGraduation=server.createobject("adodb.recordset")
sqlGraduation="select * from Graduation where adid='"&adid&"' "
rsGraduation.open sqlGraduation,conn,1,1
set rsstudent=server.createobject("adodb.recordset")
sqlstudent="select * from student where adid="&adid
rsstudent.open sqlstudent,conn,1,1
session("status_numberok")=rsstudent("status_number")
set rsScore=server.createobject("adodb.recordset")
sqlScore="select * from Score where status_number='"&session("status_numberok")&"' "
rsScore.open sqlScore,conn,1,1
session("del_student")=adid
if rsstudent.eof and rsstudent.bof then
response.write "<SCRIPT LANGUAGE=JavaScript>alert (' 抱歉暂时没有数据!');window.location.href='admin_head.asp';</script>"
else
set rspl=server.createobject("adodb.recordset")
sqlpl = "select * from comment where com_classname = "&session("com_classname")&" order by com_id desc"
rspl.open sqlpl,conn,1,1
if dengji = 1 then
%>
<% name2 = year(now())-year(rsstudent("student2") ) %>
好像也不行。。能不能给我个完整的??谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询