有游标做:
sqlca.autocommit=true
string czy100
declare cursor1 cursor for select distinct username from mima;
open cursor1;
fetch cursor1 into :czy100;
do while sqlca.sqlcode=0
fetch cursor1 into :czy100;
integer li_rtn
li_rtn = CreateDirectory ('c:\'+czy100)
If li_rtn = 1 Then
MessageBox('提示信息',' C:\czy100目录创建成功!')
Else
MessageBox('提示信息','C:\czy100目录创建失败!')
End if
loop
close cursor1;
sqlca.autocommit=false // 我遇到一个问题是最后的一条记录创建失败!!不知道为什么?这段代码,供楼主参考!!