数据库表刷新问题
我写了下面的代码:Private Sub Command1_Click()
Dim db As Database
Dim addr As String
addr = App.Path + "\penglaige.mdb"
Set db = OpenDatabase(addr)
sql = "select 售票员编号,售票员姓名,销售面值,sum(销售张数) as 销售数量合计,sum(金额)as 销售金额合计 into temp from 门票销售 group by 售票员编号,售票员姓名,销售面值"
db.Execute "drop table temp"
db.Execute sql
Adodc1.RecordSource = "select * from temp"
Adodc1.Refresh
Call ExportToExcel(Adodc1.Recordset, "报表") //将temp中的数据导出到excel中
End Sub
想将每次临时表产生的数据导出到excel中,可这样写的话什么都导不出,原因是temp 没有刷新,需要在需要在db.Execute sql后面刷新一下temp,可是怎样刷新表temp 呢?