hi ...
Any idea please?
Also i tryed to do something diferent, before insert i try to do a select ,but also 0 records... two tables have records with same TEL_NUM_FACTURA ,if i do a select * from tabla1 i have records, and also a tel.tel_nu_telefono="SERRA" also i have a record, but no one with left join...
Dim miconexion As New ADODB.Connection
Dim mirecordset As New ADODB.Recordset
Dim instruccion As String
' instruccion = "select * from Tabla1 as t1 where t1.TEL_NU_TELEFONO='SERRA'" ' tabla1 referencia a la tabla de la base de datos externa
' instruccion = "SELECT * FROM Tabla1 as t2 LEFT JOIN Tabla1 as t1 ON t1.[TEL_NUM_FACTURA] = t2.[TEL_NUM_FACTURA] WHERE ((t1.TEL_NUM_FACTURA) Is Null)"
instruccion = "SELECT * FROM Tabla1 as t1 LEFT JOIN Tabla1 as t2 ON t1.TEL_NUM_FACTURA = t2.TEL_NUM_FACTURA WHERE ((t2.TEL_NUM_FACTURA) Is Null)"
' instruccion = "SELECT * from Tabla1 as t1"
miconexion.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & strpath
mirecordset.Open instruccion, miconexion, adOpenDynamic, adLockOptimistic
' mirecordset.Open instruccion, miconexion, , , adCmdText
Dim c As Long
c = 0
Do Until mirecordset.EOF
c = c + 1
Debug.Print (mirecordset.Fields(1) & ";" & mirecordset.Fields(2) & ";" & mirecordset.Fields(3) & ";" & c)
' Debug.Print mirecordset!TEL_NUM_FACTURA & " " & mirecordset!TEL_NU_TELEFONO
mirecordset.MoveNext
Loop
mirecordset.Close
Set mirecordset = Nothing
miconexion.Close
Set miconexion = Nothing
End Sub