Run-Time Error '8021' with MSComm

Hi all,
   I currently am using two MSComm object to read from two serial ports. One is connected to a barcode reader and the other to a weigh scale.

After running for some time i recieve an

Run-Time Error '8021'
Internal error retrieving device control block for the port.

I am not sure why i am getting it and can't seem to find any way to solve the problem. Has anyone run into this problem before? I will be happy to post sections of the source code if necessary.

Thanks Much.
Who is Participating?
Found some info here (
that seems to indicate the problem you're having may be a result of the client PCs having two NICs (presuming they're both
in use).  Possible solutions offered can be found under "WORKAROUND" on the page.  If two NICs are in use, would it be possible to disconnect one while scanning packages?

Hi, jbutterfieldAtDiamond.

Hopefully an Expert with experience will post a better answer, but possibly the direction at this URL is the way to go:

E.g. set up an error trap to reset the comm port to your devices?  
jbutterfieldAtDiamondAuthor Commented:
Hi Edwardiii,
Thanks for the idea but this really isn't an option for me becuase each time i close and reset, because of this error, i miss a box. This is an automated system and any missed packages can spell disaster. Of course i have error trapped the condition already but i would like to find a solution to this one.. i am def. stumped.

I should mention that i the client pc is a Windows XP SP 2 with a SIIG PCI two port serial card and two NIC cards installed. One NIC is onboard, the other is a PCI card. The comptuer also has an onboard serial port we are not using.

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Ok.  One last thought--if you preface your routine with "On Error Resume Next", does the MSComm force a re-acquisition of the control block, with no loss of data?
jbutterfieldAtDiamondAuthor Commented:
Once the error occurs the program locks up... so i can't image a resume next would work... but i will give it a shot.

If you have any other ideas that would be great. I would rather fix the problem rather than bypass it like this.. ya know.
Understood:)  I just wanted to present the Resume Next because I've run into various coding through time that throws an error and Resume Next enables processing to continue with no loss of data.  
Shiju SasidharanAssoc Project ManagerCommented:
can u please  post the code and mark the position where u get the error ?
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.

All Courses

From novice to tech pro — start learning today.