Dim rs2 As New ADODB.Recordset
Dim str As String
cnn.Execute "select top " + Text1.text + " * into xxx from jsjztk1 where 难度='" + Combo4.text + "' and 章节= '" + Combo3.text + "'and 题型= '" + Combo2.text + "' "
Dim rs1 As New ADODB.Recordset
rs1.Open "select * from xxx", cnn, adOpenKeyset, adLockOptimistic
Set Grid1.DataSource = rs1
当我改变combox控件中的内容的时候,抽取条件改变,怎么实现累计添加
我现在是下一次抽取覆盖掉了上一次
grid1表示一个datagrid控件

解决方案 »

  1.   

    cnn.Execute "INSERT INTO xxx ................ "
      

  2.   

    Set jeeyeys = CreateObject("ADODB.Recordset")
      

  3.   

    'xxx表先建好,然后语句改一下应该就会变成追加了,你原来那个语句二次执行不报错吗?
    cnn.Execute  "insert into xxx select top " + Text1.text + " * from jsjztk1 where 难度='" + Combo4.text + "' and 章节= '" + Combo3.text + "'and 题型= '" + Combo2.text + "' "