Error 5 in VB - Very Rare ... ???
Posted on 2004-10-25
I have a VB app I have loaded on at least 100 XP workstations. It works without error probably 99.5% of the time. It's a pretty simple message utility that uses an Oracle database. It is a heavily used application (7x24) that stays active throughout each person's eight-hour shift. About twice a month on assorted workstations, one or two users of this app will get an "Error 5 - Invalid Procedure Call or Argument" pop up. It's not simultaneous; there doesn't seem to be any pattern. They exit the app and restart, and all is well. I have inserted an error handler to isolate the error, and it reports that the error occurs in "Housecleaning", a small section of code that handles some rather unspectacular tasks...
'Set Detail Error Message
DetailError = "Housecleaning"
'Reset the display of both the groups and the people back to the top of the list, call
'WipeMessage to clear the entry box, set the Reciept Check to False, set Send to History
'to True, and set focus back to the entry box
lstAllUserNames.TopIndex = 0
lstAllGroups.TopIndex = 0
chkReciept.Value = False
chkHistory.Value = 1
'Re-enable the timer
tmrSendMsg.Enabled = True
(This is the "Wipe Message" code which is called above):
MousePointer = vbHourglass
If ClearMsgAfterSend.Checked = True Then
Text_Message.Text = vbNullString
MousePointer = vbNormal
I cannot find any reason for an Error 5 message. Do you see anything that could trigger an error?