Hi everybody !
I want to verify in one database if there is identical records and keep only one of them...
Here below it's what I tried (Sorry some words are in french):
I got an error on the underlined line:VB Code:
'Instanciation des variables Set cn = New ADODB.Connection Set cn1 = New ADODB.Connection Set rs = New ADODB.Recordset Set rs1 = New ADODB.Recordset 'Connection Database cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & ImpressionMDB cn.Open cn1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & ImpressionMDB cn1.Open 'Ouverture des recordset rs.Open "Items", cn, adOpenKeyset, adLockPessimistic, adCmdTable rs1.Open "Items", cn1, adOpenKeyset, adLockPessimistic, adCmdTable 'Vérifier si item identique rs.MoveFirst Do Until rs.EOF rs1.MoveFirst Do Until rs1.EOF [U]If rs.Fields("Description").Value = rs1.Fields("Description").Value Then[/U] rs.Delete End If rs1.MoveNext Loop rs.MoveNext Loop 'Fermeture de la connection cn.Close cn1.Close rs.Close rs1.Close Set cn = Nothing Set cn1 = Nothing Set rs = Nothing Set rs = Nothing
Runtime Error -2147217885 (80040e23) : A Given HROW Referred to a Hard-Deleted or Soft-Deleted Row
If you have other suggestion, let me know !
Thanks in advance !





Reply With Quote