I am using Visual Basic 6 to write a program to pull all the contacts (and their notes/history) out of ACT 2000 and put it into an MSSQL database.
For the most part it is working fine, but every so often the loop that is grabbing the History items slips and gets "out of synch", and I don't understand why.
Here is the general layout of my loop and then I'll explain what I mean by "out of synch"
//ACTuniqueID is the unique ID for this particular contact
objDatabase3.NOTEHISTORY.Lookup 29, ACTuniqueID, 1
a = 0
While Not objDatabase3.NOTEHISTORY.IsEOF
//Check to see if we've moved beyond the EOF
If a > (objDatabase3.NOTEHISTORY.RecordCount + 1) Then
MsgBox "History count has gone over record count"
historyDate = objDatabase3.NOTEHISTORY.Data(27)
historyType = objDatabase3.NOTEHISTORY.Data(25)
//getACTname does another lookup (with objDatabase2 ) to translate the unique ID to a contact Name
historyOwner = getACTname(objDatabase3.NOTEHISTORY.Data(6))
historyItem = objDatabase3.NOTEHISTORY.Data(26)
//Code to enter the 4 bits of info we pulled goes here
a = a + 1
So in theory this should do a lookup to get only Contact X's notes/history, move to the first item in that list, and then walk one by one pulling out the 4 bits of info I want and inserting them into the MSSQL DB.
For the most part it does this, it'll do 100 in a row with no problem, but once in awhile it hits a contact (A different one on each run) and "slips"... MoveNext basically stop working, EOF is never reached, and my variable 'a' just grows and grows (hence the message box lines at the start of the loop)
If I query objDatabase3.NOTEHISTORY.Position it will be lower than the RecordCount, but calling MoveNext does not increment it and I basically have to scrap the run and start over.
Has anyone seen this before, or had similar issues with the SDK? I suspect it's a memory or buffer issue, but I don't see anything about it on the ACT site, or in the SDK documentation.
I know there is a 3rd party program I could use to export the notes/history, but I'd like to be able to just do it with the SDK if possible. It does work for most contacts, I don't see any common history item type or content that seems to hang it up, seems fairly random when it stops, which is why I suspect memory/buffer issues.
Please let me know if you have any suggestions.