A
alxw3 via AccessMonster.com
i'm exporting data ,10000 to 15000 rows, from excel to an access 2003 table.
it stops in middle due to duplicate records in the table. my table can not
have duplicated rows. How do i check if a row (field1, field2, field3)
already exist not to add?. what's is best practice?.
Dim conn As ADODB.Connection, rs As ADODB.Recordset
dim count as long
rs.Open "mytable1", conn, adOpenKeyset, adLockOptimistic, adCmdTable
while loop
with rs
.addnew
.Fields("field1") = Range("A" & count).Value
.Fields("field2") = Range("B" & count).Value
.Fields("field3") = Range("C" & count).Value
.update
end with
count = count + 1
it stops in middle due to duplicate records in the table. my table can not
have duplicated rows. How do i check if a row (field1, field2, field3)
already exist not to add?. what's is best practice?.
Dim conn As ADODB.Connection, rs As ADODB.Recordset
dim count as long
rs.Open "mytable1", conn, adOpenKeyset, adLockOptimistic, adCmdTable
while loop
with rs
.addnew
.Fields("field1") = Range("A" & count).Value
.Fields("field2") = Range("B" & count).Value
.Fields("field3") = Range("C" & count).Value
.update
end with
count = count + 1