来生缘老师:第九步查找中,我略作修改:将找到的记录写入临时表temp中,再连接临时表,下面代码怎么写不进去呢?(打开临时表看不到任何记录写入) Private Sub CommandButton8_Click() CommandButton11.Caption = "返回主界面" Application.ScreenUpdating = False ListView1.ListItems.Clear Call mycnn cnn.Execute "delete from temp" Strsql = "Select * From 主表" rst.Open Strsql, cnn, 1, 3 Strsql = "insert into temp select * from 主表 where " For i = 1 To 28 If Controls("textbox" & i) <> "" Then Strsql = Strsql & rst.Fields(i).Name & " like '*" & Controls("textbox" & i).Text & "*' and " End If Next Strsql = Left(Strsql, Len(Strsql) - 4) strsqlfind = Strsql cnn.Execute strsqlfind '将查找到记录写入临时表 Set rst = Nothing Set cnn = Nothing end sub |