ACT 2000, exporting History using the SDK

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"
   End If

   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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


You could be hitting bad data.  Have you tried running a scan and repair using actdiag - also a compress and reindex?

I wouldn't waste time when this tool is only $250:

kkonkleAuthor Commented:
Actually yesterday evening we tried consolidating everything on a single machine, and had good success.

Originally it was running from my machine, going over the local network to ACT, coming back to my machine, then going over the local network to another machine to store the data.  Not only that, but during the day ~50-70 people were inside that ACT DB using it too, which I'm sure didn't help things.

Once we moved everything to a single machine, with a copy of the ACT DB and a copy of the MSSQL DB saved locally, it ran just fine and my history out of synch warning never fired off.

I was not aware of actdiag though, might be a good idea to run that anyway, at least a compress and index.  Thanks for the tip.

I see - you were probably running into some network delays.  I'm glad everything is working now.

Run the "scan and repair" option in actdiag before the process and then open ACT! and click File, Database Administration, Compress & Reindex.  That will help reassign orphan records, fix index problems, etc.

If you want to be really complete you can manually delete the indexes (also an option in actdiag) - these are *.**X - ACT! will rebuild them on the next database open.  Sometimes those .dbf index files would become damaged.  That might be overkill if you're getting good results.

Good luck

PAQed with points refunded (350)

EE Admin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Would you be interested in sharing/selling your vb solution?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.