I have two MS Access databases (source and target). I am copying 5 tables from the source to new tables in the target. I'm using an ASP script on a web site. This is a repetitive process that has to be done every few weeks by users. All source tables have no empty rows. Same code to copy the tables, with each source and target passed in to the subroutine. Four of the tables copy perfectly with a SELECT data cursor and then INSERT each row within the loop. The problem table copies fine -- except: I display a process bar and and count each INSERT and the result is always 95247 rows INSERTed. The exact number in the source table. However, the target table has 102,432 rows -- the extra rows are all blank. There are no empty rows in the source and, in fact, I SELECT DISTINCT and then further test if a key column is blank or Null before doing the INSERT. The happens every time, as I've tested it probably 15 times. Code can't be copied from an off-line system, but here's the psuedo:
Select Cursor from Source
Do Until EOF
If key not blank and not Null
- Insert row into Target and count + 1
End
MoveNext
Loop
Close cursor
Display Insert count (95247)
I've had to add Delete blank rows, but should not have to