Michael,
Speaking strictly in VB6/16-bit terms:
An integer uses the 16th bit to indicate positive/negative. Thus, 8000 is -32767 or something like that. When this is passed as bytes or anything where the 16th bit is just another bit, then it works fine. However, it is stored in the database as a signed value, and so it is written as a negative integer and then read into a long integer, so the sign is retained. In the case of &H8000, it becomes &H80000000 because the sign bit is now the 32nd bit instead of the 16th bit. This means that the SetIO bit is turned OFF just through the act of passing this value through different sized variables.
Speaking strictly in VB6/16-bit terms:
An integer uses the 16th bit to indicate positive/negative. Thus, 8000 is -32767 or something like that. When this is passed as bytes or anything where the 16th bit is just another bit, then it works fine. However, it is stored in the database as a signed value, and so it is written as a negative integer and then read into a long integer, so the sign is retained. In the case of &H8000, it becomes &H80000000 because the sign bit is now the 32nd bit instead of the 16th bit. This means that the SetIO bit is turned OFF just through the act of passing this value through different sized variables.
Comment