如何用vb代码把access数据库中数据表里不符合要求的记录删除,最好能给我代码

解决方案 »

  1.   

    Dim db As New ADODB.Connectiondb.ConnectionString = "provider=microsoft.jet.oledb.4.0;" & "data source=" & App.Path & "\dev.mdb"
    db.Opendb.Execute "delete from tablename where index<300 "'将index小于300的记录全部删除
      

  2.   

    你把想删除的条件放到where 后就可以了Dim cnn As New ADODB.Connection
    cnn.open = "provider=microsoft.jet.oledb.4.0;" & "data source=" & App.Path & "\dev.mdb" & ";Persist Security Info=False"
    cnn.Execute "delete from tablename where 条件"