sql和asp查询显示的问题。。高手进来瞟一眼。
来源:百度知道 编辑:UC知道 时间:2024/06/16 13:05:19
<%=(Recproview.Fields.Item("pro_name").Value)%>
现在这个只能查询一个字段的,但是不能查询指定的行
我现在想查询行为Id 23 的。列为pro_name的数据不知道怎么查询。
select pro_name from 表名 where id=23
这个我也用过但是由于这个 select pro_name from 表名 where id=23 是放在网页的前面的。
而我提问的内容却需要显示几个,如果用了这个就会冲突
以下是完整的
<%
Dim www3
Dim www3_numRows
Set www3 = Server.CreateObject("ADODB.Recordset")
www3.ActiveConnection = MM_www_STRING
www3.Source = "SELECT news2_content FROM news2"
www3.CursorType = 0
www3.CursorLocation = 2
www3.LockType = 1
www3.Open()
www3_numRows = 0
%>
</head>
<body>
<%=(www3.Fields.Item("news2_content").Value)%>
</body>
现在这个只能查询一个字段的,但是不能查询指定的行
我现在想查询行为Id 23 的。列为pro_name的数据不知道怎么查询。
select pro_name from 表名 where id=23
这个我也用过但是由于这个 select pro_name from 表名 where id=23 是放在网页的前面的。
而我提问的内容却需要显示几个,如果用了这个就会冲突
以下是完整的
<%
Dim www3
Dim www3_numRows
Set www3 = Server.CreateObject("ADODB.Recordset")
www3.ActiveConnection = MM_www_STRING
www3.Source = "SELECT news2_content FROM news2"
www3.CursorType = 0
www3.CursorLocation = 2
www3.LockType = 1
www3.Open()
www3_numRows = 0
%>
</head>
<body>
<%=(www3.Fields.Item("news2_content").Value)%>
</body>
还是看不明白你要表达的意思.我的看法跟楼上的一样,用条SQL语句就好了.
select * from table where id=23
所有的字段都有了.
写SQL语句查询
select pro_name from 表名 where id=23
这样就可以搞定了
www.xdaiwang.cn-小戴网-欢迎你
如果你要显示几个。。。你创建纪录集多几个就好了啊。。。。。