在MSSQL 里
查询语句只要这样写,就可以随机取出记录了
SQL="Select top 6 * from Dv_bbs1 where isbest = 1 and layer = 1 order by newID() desc"
在ACCESS里
Randomize
sqls="select top 6 a.title,a.Author,a.HtmlName,A.AddTime,a.hits,b.EanClass,s.Enclass from article a,article_Anclass b,article_Nclass s where
a.BclassID=b.AnClassID and a.SclassID=s.NclassID and Elite=true order by Rnd(-(a.articleid+"&Rnd()&")) desc"
后面 order by Rnd(-(a.articleid+"&Rnd()&")) desc 就可以了