# Re: 资料库查询存档的问题...依然解决不了

Posted by andyLin on April 11, 1999 at 23:49:53:

In Reply to: 资料库查询存档的问题...依然解决不了 posted by 林文芳 on April 11, 1999 at 22:33:31:

: Dim rs As Recordset
: Dim db As Database

: Set db = DBEngine.Workspaces(0).OpenDatabase("f:\test.mdb")
: Set rs = db.OpenRecordset("测试")
: Set Data1.Recordset = rs
: Set rs = db.OpenRecordset("select * into [查存] from [测试] where [AAA] > 5")
: Set Data1.Recordset = rs

: 执行后居然会出现"无效的操作"的错误讯息...
: 但若是改成
: Set rs = db.OpenRecordset("select * from [测试] where [AAA] > 5")
: 就可以正确执行...
: 但我就是想要将查询后的资料另存在[查存]这个Table中
: 语法也没有用错ㄚ...请各位帮帮忙...救救我吧!!!

应该是:
: db.execute("select * from [测试] where [AAA] > 5")
然后再:
Set rs = db.OpenRecordset("select * from [测试] where [AAA] > 5")
试试看吧!

Follow Ups: