aod dim rs as adodb.recordset set rst=new adodb.recordset rst.open("select distinct profession form table if not rst is nothing then while not rst.eof list.additem rs!字段 rst.movenext wend rst.closed end if
aod dim rs as adodb.recordset set rst=new adodb.recordset rst.open("select distinct profession form table if not rst is nothing then while not rst.eof list.additem rs!字段 rst.movenext wend rst.closed end if
FROM 表
GROUP BY 专业
while not rs.eof
list.additem rs("字段")
rs.movenext
loop
rst.Open strSql, CN, adOpenForwardOnly, adLockReadOnly, adCmdText
while not rst.eof
Lst.AddItem Trim(rst.Fields(0).Value)
rst.movenext
wend
SELECT 专业
FROM 表
GROUP BY 专业
用select distinct 专业 from 表
如果记录多的时候明显会感觉到的!!
执行起来效率不高
rs.open "select 英语 from 专业 group by 英语",
list1.clear
for i=1 to rs.recound
list1.additem rs![英语]
rs.movenext
next
[email protected]
dim rs as adodb.recordset
set rst=new adodb.recordset
rst.open("select distinct profession form table
if not rst is nothing then
while not rst.eof
list.additem rs!字段
rst.movenext
wend
rst.closed
end if
dim rs as adodb.recordset
set rst=new adodb.recordset
rst.open("select distinct profession form table
if not rst is nothing then
while not rst.eof
list.additem rs!字段
rst.movenext
wend
rst.closed
end if
连接无法用于此操作。在此上下文中它可能已被关闭或无效。
谁做个例子给我吧!!