sqlstr="select place.placename,lxh.lxhid from place,lxh where lxh.userid="&userid&" and lxh.lxhrid=place.lxhid"
set rs=server.createobject("adodb.recordset")
rs.open sqlstr,conn,1,1
注意userid为字符串时加单引号
<%=rs("placename")%>
只显示place.placename,就不需要第一张表
如果是access作一个查询Search_test,这三张表就好像一张表,其关系是通过user.userid=lxh.userid and lxh.lxhrid=place.lxhid来查询实现的
这样你要显示只需要操作Search_test就可以了,但好像只能用Search_test来显示,不能更新数据
我想其它类同