前台是VB数据库是ACC,我有个信息是5类,但是只想在前台显示其中一类的信息怎么写代码.

来源:百度知道 编辑:UC知道 时间:2024/06/11 10:08:53
<%
Dim rs_jobhire : Set rs_jobhire = Mocola.Execute("select * from JOB_about")
If rs_jobhire.Eof and rs_jobhire.Bof Then
Response.End
Else
dim num
dim hiretdclsname
num=0
Do While Not rs_jobhire.Eof
if num mod 2=0 then
hiretdclsname = "x-x-2"
else
hiretdclsname = "x-x-3"
end if
Response.Write("<tr class='" & hiretdclsname & "'>")
Response.Write("<td width='50%'>"& rs_jobhire("title") & "</td>")
Response.Write("<td width='30%'>"& rs_jobhire("dateandtime") & "</td>")
Response.Write("</tr>")
num = num+1
if num>8 then exit do
rs_jobhire.MoveNext
Loop
End If%>
我想只要一类的代码,谢谢 在线等

Set rs_jobhire = Mocola.Execute("select * from JOB_about")这是你的数据库查询语句,语句格式的:
select 字段名1,字段名2,字段名3,...,字段名n from 表名[ where 条件1,条件2,条件3,...] '[]部分表示附加条件,可要可不要;如果要查询全部字段,则用*代替“字段名1,字段名2,字段名3,...,字段名n”……

按你的意思是只显示数据库表中的一个字段,假设你要显示的字段名称是title,则你的查询语句可以这样写:
Set rs_jobhire = Mocola.Execute("select title from JOB_about")

我这样解释你明白吧?