Este es un ejemplo hecho en Visual Basic, pero yo lo quiero en asp
siendo rstVtasCheck recordset de un select a sql server
y rstCheckFact recorset abierto para comparar datos
si el dato existe... pasa al siguiente registro
si no existe lo copia en la tabla acces
Gracias
Código:
With rstVtasCheck
.MoveFirst
Do While Not .EOF
sw = 0
Folio = !Folio
rstCheckFact.Seek "=", Val(Folio)
If rstCheckFact.NoMatch Then
'MsgBox "No aparece"
sw = 0
Else
'MsgBox "Apareció"
sw = 1
End If
If sw = 0 Then
NroInt = !NroInt
Fecha = !Fecha
codaux = !codaux
NomAux = !NomAux
CodVend = !Codvendedor
With rstCheckFact
.AddNew
!Folio = Folio
!NroInt = NroInt
!Fecha = Fecha
!codaux = codaux
!NomAux = NomAux
.Update
End With
End If
.MoveNext
Loop
End With