28/11/07 18:19
moet
OPS ECCOLO IL CODICE CORRETTO. MA NON CANCELLA NEL DATABASE!
Private Sub Command3_Click() Dim c As ListItem Dim n As Integer Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset stringa = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" stringa = stringa & App.Path & "\componenti.mdb" Dim ind As Integer For Each c In ListView.ListItems If c.Selected Then ind = c.Index ListView.ListItems.Remove c.Index Exit For End If Next cn.Open stringa rs.Open "Tabella1", cn, 3, 3 cn.Execute "Delete from tabella1 where id = " & CStr(ind) rs.Close Set cn = Nothing Set rs = Nothing End Sub
aaa