想把查询结果放到MDB文件中的一张表里可以用一条SQL语句完成,如把A表中AA字段大于100的查询结果放入一张你需要的新表中 select * into YourTableName from A where AA>100回车键是vbKeyReturn
第一个问题: dim fso as new FileSystemObject if recordset.recordcount =0 then exit sub end if open "filename.txt" for output as #1 do while not recordset.Eof print #1,recordset.fields(0).value & recordset.field(n) loop close #1 第二个问题: 可以发送按键信息 private sub keypress(Ascii as integer) SendKeys("{Enter}") end sub
to:LeeChengYu if recordset.recordcount =0 then exit sub end if open "filename.txt" for output as #1 do while not recordset.Eof print #1,recordset.fields(0).value & recordset.field(n) loop close #1 这种方法速度太慢,我试过输出一个26000条记录,用了很久,有没有快点的方法,比如说成批输出?
select * into YourTableName from A where AA>100回车键是vbKeyReturn
dim fso as new FileSystemObject
if recordset.recordcount =0 then
exit sub
end if
open "filename.txt" for output as #1
do while not recordset.Eof
print #1,recordset.fields(0).value & recordset.field(n)
loop
close #1
第二个问题:
可以发送按键信息
private sub keypress(Ascii as integer)
SendKeys("{Enter}")
end sub
if recordset.recordcount =0 then
exit sub
end if
open "filename.txt" for output as #1
do while not recordset.Eof
print #1,recordset.fields(0).value & recordset.field(n)
loop
close #1
这种方法速度太慢,我试过输出一个26000条记录,用了很久,有没有快点的方法,比如说成批输出?