asp如何写入Access(高手帮忙)
我现在找到一个网站程序,但是他后台有限制,不能发布新闻,产品等等信息,但是可以察看信息,我想请教下,如何才能将自己的新闻,产品添加到数据库里面了。添加新闻的文件在下面,高...
我现在找到一个网站程序,但是他后台有限制,不能发布新闻,产品等等信息,但是可以察看信息,我想请教下,如何才能将自己的新闻,产品添加到数据库里面了。添加新闻的文件在下面,高手帮忙指导下。谢谢了。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "tuzh_pri.asp"-->
<!--#include file ="../connadmin.asp"-->
<%if request.QueryString("action")="modi" and trim(request.QueryString("id"))<>"" then
dim modi
modi="y"
set rsok=server.createobject("adodb.recordset")
sqlok="select * from com where id="&cint(trim(request.QueryString("id")))
rsok.open sqlok,conn,1,1
doid=rsok("id")
title= rsok("title")
content= rsok("content")
kind_id= rsok("yiid")
rsok.close
set rsok=nothing
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../img/css.css">
<title></title>
<title>无标题文档</title>
<SCRIPT language=JavaScript>
function checklogin() {
if (document.form1.kind.value=="") {
alert("请选择类别!");
form1.kind.focus();
return false;
}
if (document.form1.txttitle.value=="") {
alert("请输入标题!");
form1.txttitle.focus();
return false;
}
return true;
}
</SCRIPT>
</head>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from com_kind"
rs.open sql,conn,1,1
dim lm1
lm1=""
do while not rs.eof
if modi="y" and kind_id=rs("yiid") then
lm1=lm1&"<option value='" & rs("yiid") & "' selected>" & rs("yiname")&"</option>"
else
lm1=lm1&"<option value='" & rs("yiid") & "'>" & rs("yiname")&"</option>"
end if
rs.movenext
loop
rs.close%>
<body class="body_back">
<form name="form1" method="post" onSubmit="return checklogin()" action="com_newsdo.asp?yiid=<%=trim(request.QueryString("yiid"))%>">
<table class="border" width="95%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td height="49" align="center" valign="top" class="bg_low"> <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" class="bgtop"><font class="bgtop_title">发布/修改信息</font>
</td>
</tr>
</table>
蓝木企业网站全站系统 蓝木企业网站全站系统 展开
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "tuzh_pri.asp"-->
<!--#include file ="../connadmin.asp"-->
<%if request.QueryString("action")="modi" and trim(request.QueryString("id"))<>"" then
dim modi
modi="y"
set rsok=server.createobject("adodb.recordset")
sqlok="select * from com where id="&cint(trim(request.QueryString("id")))
rsok.open sqlok,conn,1,1
doid=rsok("id")
title= rsok("title")
content= rsok("content")
kind_id= rsok("yiid")
rsok.close
set rsok=nothing
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../img/css.css">
<title></title>
<title>无标题文档</title>
<SCRIPT language=JavaScript>
function checklogin() {
if (document.form1.kind.value=="") {
alert("请选择类别!");
form1.kind.focus();
return false;
}
if (document.form1.txttitle.value=="") {
alert("请输入标题!");
form1.txttitle.focus();
return false;
}
return true;
}
</SCRIPT>
</head>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from com_kind"
rs.open sql,conn,1,1
dim lm1
lm1=""
do while not rs.eof
if modi="y" and kind_id=rs("yiid") then
lm1=lm1&"<option value='" & rs("yiid") & "' selected>" & rs("yiname")&"</option>"
else
lm1=lm1&"<option value='" & rs("yiid") & "'>" & rs("yiname")&"</option>"
end if
rs.movenext
loop
rs.close%>
<body class="body_back">
<form name="form1" method="post" onSubmit="return checklogin()" action="com_newsdo.asp?yiid=<%=trim(request.QueryString("yiid"))%>">
<table class="border" width="95%" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td height="49" align="center" valign="top" class="bg_low"> <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" class="bgtop"><font class="bgtop_title">发布/修改信息</font>
</td>
</tr>
</table>
蓝木企业网站全站系统 蓝木企业网站全站系统 展开
2个回答
展开全部
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file = "tuzh_pri.asp"-->
<!--#include file ="../connadmin.asp"-->
<%if request.QueryString("action")="modi" and trim(request.QueryString("id"))<>"" then
dim modi
modi="y"
set rsok=server.createobject("adodb.recordset")
sqlok="select * from com where id="&cint(trim(request.QueryString("id")))
rsok.open sqlok,conn,1,3
rsok.addnew
doid=rsok("id")
title= rsok("title")
content= rsok("content")
kind_id= rsok("yiid")
rsok.update
rsok.close
set rsok=nothing
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../img/css.css">
<title></title>
<title>无标题文档</title>
<SCRIPT language=JavaScript>
function checklogin() {
if (document.form1.kind.value=="") {
alert("请选择类别!");
form1.kind.focus();
return false;
}
if (document.form1.txttitle.value=="") {
alert("请输入标题!");
form1.txttitle.focus();
return false;
}
return true;
}
</SCRIPT>
</head>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from com_kind"
rs.open sql,conn,1,1
dim lm1
lm1=""
do while not rs.eof
if modi="y" and kind_id=rs("yiid") then
lm1=lm1&"<option value='" & rs("yiid") & "' selected>" & rs("yiname")&"</option>"
else
lm1=lm1&"<option value='" & rs("yiid") & "'>" & rs("yiname")&"</option>"
end if
rs.movenext
loop
rs.close%>
<!--#include file = "tuzh_pri.asp"-->
<!--#include file ="../connadmin.asp"-->
<%if request.QueryString("action")="modi" and trim(request.QueryString("id"))<>"" then
dim modi
modi="y"
set rsok=server.createobject("adodb.recordset")
sqlok="select * from com where id="&cint(trim(request.QueryString("id")))
rsok.open sqlok,conn,1,3
rsok.addnew
doid=rsok("id")
title= rsok("title")
content= rsok("content")
kind_id= rsok("yiid")
rsok.update
rsok.close
set rsok=nothing
end if%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../img/css.css">
<title></title>
<title>无标题文档</title>
<SCRIPT language=JavaScript>
function checklogin() {
if (document.form1.kind.value=="") {
alert("请选择类别!");
form1.kind.focus();
return false;
}
if (document.form1.txttitle.value=="") {
alert("请输入标题!");
form1.txttitle.focus();
return false;
}
return true;
}
</SCRIPT>
</head>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from com_kind"
rs.open sql,conn,1,1
dim lm1
lm1=""
do while not rs.eof
if modi="y" and kind_id=rs("yiid") then
lm1=lm1&"<option value='" & rs("yiid") & "' selected>" & rs("yiname")&"</option>"
else
lm1=lm1&"<option value='" & rs("yiid") & "'>" & rs("yiname")&"</option>"
end if
rs.movenext
loop
rs.close%>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |