| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 708 人关注过本帖
标题:同一个页面显示两个数据库的内容?
只看楼主 加入收藏
asd123789
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-5-18
收藏
 问题点数:0 回复次数:2 
同一个页面显示两个数据库的内容?
EzM7I7qk.rar (49.62 KB) 同一个页面显示两个数据库的内容?



bjgd.asp中显示数据库中的注册号和字号名称等几个信息,当用鼠标点击注册号时就显示整个详细的内容。这个里面是用循环按ID顺序来显示数据库的内容。


一个表是jbb有字段zch(注册号),mc(名称),lxr(联系人),dh(电话)等,另一个表qzzj中有字段 zch(注册号),zjmc(证件名称),fzjg(发证机关),yxrq(有效日期)。

我想在网页中显示jbb表中整个字段的内容,我用什么样的SQL语句,并且在网页中显示出qzzj表中整个字段的内容.因为是从bjgd.asp中点击后调用两个数据库里的内容。所以没有做出来。

请赐教.

[此贴子已经被作者于2006-5-19 10:31:00编辑过]

搜索更多相关主题的帖子: 数据库 SQL 鼠标 字段 页面 
2006-05-18 18:38
asd123789
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-5-18
收藏
得分:0 

附件里是我做的程序。

我在shownews.asp中程序:
<!--#include file="data1.asp"-->
<%
'从数据库jbb(经济户口表)中的pq字段和表class(片区分类)class_ID字段相联系的地方,显示出片区分类

dim id1

id1=request("id")
if id1="" then response.End

sql2="select class.class_id as class1,class.class as class2 from jbb,class where jbb.id="&id1& "and class.class_id=jbb.pq "
Set rs2= Server.CreateObject("ADODB.Recordset")
rs2.open sql2,conn,1,3

%>

<%
'从数据库jbb(经济户口表)中的pq字段和表class(片区分类)class_ID字段相联系的地方,显示出片区分类

'dim id1

'id1=request("id")
'if id1="" then response.End

'sql2="select class.class_id as class1,class.class as class2, qzzj.zch as zch1,qzzj.zjhm as zjhm1,qzzj.zjmc as zjmc1,qzzj.fzjg as fzjg1,qzzj.fzrq as fzrq1,qzzj.yxrq as yxrq1 from jbb,class,qzzj where jbb.id="&id1& "and class.class_id=jbb.pq and qzzj.zch=jbb.zch "
'Set rs2= Server.CreateObject("ADODB.Recordset")
'rs2.open sql2,conn,1,3

%>


<%
'显示前置证件数据库中的内容

sql3="select qzzj.zch as zch1,qzzj.zjhm as zjhm1,qzzj.zjmc as zjmc1,qzzj.fzjg as fzjg1,qzzj.fzrq as fzrq1,qzzj.yxrq as yxrq1 from jbb,qzzj where jbb.id="&id1&" and qzzj.zch=jbb.zch "
Set rs3= Server.CreateObject("ADODB.Recordset")
rs3.open sql3,conn,1,1

%>
<html<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>济宁市工商局任城分局</title>
<style type="text/css">
<!--
.style8 {color: #FF6600; font-size: 16px; }
.style10 {color: #FF6600; font-size: 11px; }
-->
</style>
</head>

<body>
<%sql="select * from jbb"' where class_id='1' order by News_id desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3

'session("pq")=rs("pq")
%>
'<%
'sql6="select class.calss as class1 from class,jbb where class.class_ID=jbb.pq"
' Set rs= Server.CreateObject("ADODB.Recordset")
' rs.open sql6,conn,1,3
' %>
<input name="pq" type="text" maxlength="16" value="<%=pq1%>">
<form name="Form1" action="submit.asp" method="post" onSubmit="return check()">
<table width="100%" height="569" border="1">
<tr>
<td width="8%" height="28"><div align="left">注册号:</div></td>
<td width="16%"><%=rs("zch")%>
</td>
<td width="9%">字号名称:</td>
<td width="29%"><%=rs("zhmc")%></td>
<td width="6%">片区:</td>
<td width="32%" valign="middle">
<%=rs2("class2")%>
</td>
</tr>
<tr>
<td height="32" colspan="6"><table width="100%" border="1">
<tr>
<td width="8%" height="24">负责人:</td>
<td width="12%"><%=rs("fzr")%></td>
<td width="6%">地址:</td>
<td width="48%"><%=rs("dz")%></td>
<td width="9%">联系电话:</td>
<td width="17%"><%=rs("lxdh")%></td>
</tr>
</table></td>
</tr>
<tr>
<td height="32" colspan="6"><table width="100%" border="1">
<tr>
<td width="12%" height="28">风险度:</td>
<td width="6%"><%=rs("fxd")%></td>
<td width="9%">信用度:</td>
<td width="7%"><%=rs("xyd")%></td>
<td width="10%">监管级别:</td>
<td width="14%"><%=rs("jgjb")%></td>
<td width="16%">监管周期:</td>
<td width="26%"><%=rs("jgzq")%></td>
</tr>
</table></td>
</tr>
<tr>

<td height="33" colspan="6"><table width="100%" border="1" cellspacing="0">
<tr>
<td height="31" colspan="6"><span class="style8">前置证件:</span></td>
</tr>
<tr>
<td height="31">证件号码:</td>
<td><%=rs3("zjhm1")%></td>
<td>证件名称:</td>
<td><%=id1%></td>
<td width="9%">发证机关:</td>
<td width="23%"><input name="fzjg" type="text" id="fzjg" size=20></td>
</tr>
<tr>
<td width="10%" height="24">发证日期:</td>
<td width="25%"><input name="fzrq" type="text" id="fzrq"></td>
<td width="9%">有效日期:</td>
<td width="24%"><input name="yxrq" type="text" id="yxrq"></td>
<td colspan="2">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td height="102" colspan="6"><table width="100%" border="1">
<tr>
<td height="37" colspan="6"><span class="style8">出资情况:</span></td>
</tr>
<tr>
<td width="10%" height="45">注册资本:</td>
<td width="20%"><input name="zczb" type="text" id="zczb" value="" length='5' size=10>
(万元)</td>
<td width="10%">实收资本:</td>
<td width="19%"><input name="sszb" type="text" id="sszb" size=10> (万元)</td>
<td width="14%">出资期限:</td>
<td width="27%"><input name="czqx" type="text" id="czqx" size=10>
(万元)</td>
</tr>
<tr>
<td height="45"><p>出资方式:</p> </td>
<td height="45"><input name="czfs" type="text" id="czfs" size=20></td>
<td height="45">出资数额:</td>
<td height="45"><input name="czse" type="text" id="czse" size=10>
(万元)</td>
<td height="45" colspan="2">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td height="44" colspan="6"><span class="style8">检查处理情况:</span></td>
</tr>
<tr>
<td height="44" colspan="6"><table width="100%" border="1">
<tr>
<td width="11%" height="35">处理情况:</td>
<td width="89%"><textarea name="clqk" rows="8" id="clqk"></textarea></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" colspan="6"><div align="center">
<input name="Ok" type="submit" class="button" value="提 交">
<input name="Reset" type="reset" class="button" value="清 除">
(Enter提交)

</div></td>
</tr>
</table>
</form>
</body>
</html>

2006-05-18 18:43
asd123789
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-5-18
收藏
得分:0 
错误类型:
Microsoft JET Database Engine (0x80004005)
该特定字段 'id' 可以参考 SQL 语句中 FROM 子句列表中的多个表。
/jjhk/shownews1.asp, 第 17 行

不知道是什么原因,请高手不惜赐教。
2006-05-18 18:45
快速回复:同一个页面显示两个数据库的内容?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018706 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved