注册 登录
编程论坛 ASP技术论坛

asp 调用每篇文章和产品的标题 关键词

loveemmy 发布于 2010-10-24 08:31, 620 次点击
症状:

    网站有两类数据,一类是类似于新闻的 存储在 news 表格里   一类是产品信息,存在products里,

现在用if 语句可以调用数据库中news的的 title keyword ,而不能调用products里面的标题 关键词等

head.asp的源代码,请教啊

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<%
if Request("News_Id")<>"" then
set conn = Server.CreateObject("adodb.connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = "&Server.MapPath("App_Data/#BJdata.mdb")
Set rs = Server.CreateObject("adodb.recordset")
rs.open "Select * from bjnews where id = "&Request("News_Id"),conn,1,1
title = rs("title")
de = rs("Description")
keyword = rs("keyword")
rs.close
else
title = "百科"
de ="医学百科,医学,妇科,外科"
keyword = "医学百科,医学,妇科,外科"
end if
%>
<title><%=title%>百科</title>
<meta name="keywords" content="<%=keyword%>"/>
<meta name="description" content="<%=de%>"/>
<link href="style/style.css" rel="stylesheet" type="text/css" />
</head>
2 回复
#2
yms1232010-10-24 14:20
news跟prodcuts是两个表?LZ提供的代码只是访问一个表的

[ 本帖最后由 yms123 于 2010-10-24 14:21 编辑 ]
#3
hams2010-10-24 18:53
if 语句可以调用数据库?没听说过
1