Fun VB bug.
We had an ID that was rapidly approaching the max for a 32 bit int in a critical application. VB having no 64 bit long type, the decision was to use the currency type as it was a variant and a 64bit long underneath. We never need to do any operations on this, so it was all fine.
All good up till the point where we pass the ID to a com object. The com was expecting a 64bit long.
For no good reason, every time we pass in the ID, by the time it hit the COM code, it was incremented by 1. Tried a few things, make the COM expect a variant and convert to 64bit long, make it expect a currency type and convert to long, to no avail.
Eventually we ended up passing it as a string and having the COM expect a 64bit long. We still don't know what was happening, probably at some point in the COM interface the currency type was being converted to a float and the conversion to 64bit long was off by one, but we just don't know.
So now we have an integer ID that is a currency type variant that needs to be passed around as a string, just so it can be recognized correctly as a long on the other end.