这段代码是做什么用的?大虾帮我看看,谢了

来源:百度知道 编辑:UC知道 时间:2024/04/27 18:51:41
<%
Dim countrs
Dim countsql
Number=1
Dim count(27)
Max=27
Do While Number<=27
Set CountRS= Server.CreateObject("ADODB.Recordset")
CountSQL="Select sortid From qyml Where sortid="&number
CountRS.open countsql,conn,1,1
Count(Number)=countrs.recordcount
Number=Number+1
If Number>Max Then EXIT do
Loop
Countrs.close
Set countrs=nothing
%>

<%
Dim countrs
Dim countsql
Number=1
Dim count(27)
Max=27 '最大值
Do While Number<=27 'number小于27
Set CountRS= Server.CreateObject("ADODB.Recordset") ' 建立连接对象
CountSQL="Select sortid From qyml Where sortid="&number ' 从qyml表中查询sortid = number的数值
CountRS.open countsql,conn,1,1 '打开连接
Count(Number)=countrs.recordcount '另count(nuber)等于记录的数目
Number=Number+1 ;number自加一
If Number>Max Then EXIT do 如果number>27则退出
Loop
Countrs.close
Set countrs=nothing '关闭连接
%>

目的是找出 小于27的sortid的值在qyml的纪录数目大于27的那个最小值

Select sortid From qyml Where sortid=\"&number

从qyml表中找出sortid字段在1到27之间的所有sortid

搜索数据库qyml中sortid值从1到27的记录

VB+SQL

这是VB?