Quote:
|
Originally Posted by mbolgian
Code:
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT MACID FROM OUI WHERE MACID = '" & MMACID & "'")
If rs.EOF Then
CurrentDb.Execute "INSERT INTO OUI (MACID, Company) VALUES ('" & MMACID & "', '" & Company & "')"
End If
|
My thought is, rather than a huge number of OpenRecordsets (with all of their associated overhead), simply use Scripting.Dictionary[1] to keep track of Unique entries[2], then insert the whole lot of Dictionary entries to CurrentDb without error checking. That'll allow you to just use CurrentDb.Execute statements, no need for CurrentDb.OpenRecordset evaluations.
If you're unfamiliar with Scripting.Dictionary, look at the Master Script's ns04speech.vbs: adding at OnScanResultSpeech, regurgitating at OnScanCompleteSpeech. ns04database.vbs also has some potentially useful code. Obviously MSDN et al have more info.
[1]Assuming the language you're using exposes Scripting.Dictionary. You're using Dim with types, so my early assumption of vbscript was incorrect.
[2]Is an OUI listing with duplicates valid?