M
MikeR
I'm using an Access 2000 db as the backend for an application. I read in a text file,
parse the data I'm interested in out of the text file, and add it to the database.
I'm using DAO. I was told that the fastest way to check for dupes was to do an
update, and check the count of RecordsAffected.
I can't quite get my head around the logic. The statement I'm using returns a false
count( >0 ) on some records and I can't see why. There are 5 fields that make a
record unique (Call, U_Call, Mode, LDate and freq), altho the db has no index or pk.
I need speed and accuracy.
tmp := mutils.DateToDBFormat(Inrec.lDate) + ' ' + inRec.lTime;
sql := 'UPDATE [LOG] Set Call = "' + inRec.call + '", ' +
' LDate = #' + tmp + '#,' +
' Freq = ' + inRec.freq +
', Mode = "' + inRec.mode + '" ' +
' where u_cALL = "' + inRec.u_call + '" and LDate = #' +
tmp + '# and Mode = "' + inRec.mode + '" and Freq = ' +
inRec.freq + '" and Call = inRec.Call + '";';
dbDAO.Execute(sql);
RCnt := dbDAO.RecordsAffected;
Thanks for looking,
Mike
parse the data I'm interested in out of the text file, and add it to the database.
I'm using DAO. I was told that the fastest way to check for dupes was to do an
update, and check the count of RecordsAffected.
I can't quite get my head around the logic. The statement I'm using returns a false
count( >0 ) on some records and I can't see why. There are 5 fields that make a
record unique (Call, U_Call, Mode, LDate and freq), altho the db has no index or pk.
I need speed and accuracy.
tmp := mutils.DateToDBFormat(Inrec.lDate) + ' ' + inRec.lTime;
sql := 'UPDATE [LOG] Set Call = "' + inRec.call + '", ' +
' LDate = #' + tmp + '#,' +
' Freq = ' + inRec.freq +
', Mode = "' + inRec.mode + '" ' +
' where u_cALL = "' + inRec.u_call + '" and LDate = #' +
tmp + '# and Mode = "' + inRec.mode + '" and Freq = ' +
inRec.freq + '" and Call = inRec.Call + '";';
dbDAO.Execute(sql);
RCnt := dbDAO.RecordsAffected;
Thanks for looking,
Mike