February 28, 2021
Hot Topics:

Using the Internet Transfer Control: Part 2

  • By Sam Huggill
  • Send Email »
  • More Articles »

The best way to get to know the Inet controls constants is to look at it using the Object Browser. To do this, load up VB and add the Inet control to a form (Project, Components, Microsoft Internet Transfer Control). Now Click View, Object Browser (or press F2). From the combo box select InetCtlsObjects. You can now look through the different constants; Access constants, Data Type constants, Error constants, Protocol constants and State constants. 

To start with, we are mainly interested in the State constants. To see what each constant means, I have described them below (the number in brackets is the constants actual value):

  • icConnected (4) - Connected
  • icConnecting (3) - Connecting
  • icDisconnected (10) - Disconnected
  • icDisconnecting (9) - Disconnecting
  • icError (11) - An error has occurred
  • icHostResolved (2) - The remote address given has been accepted
  • icNone (0) - No current state
  • icReceivingResponse (7) - A response is current being received
  • icRequesting (5) - Data is currently being requested
  • icRequestSent (6) - A data request has been sent
  • icResolvingHost (1) - The remote address given is currently being checked
  • icResponseCompleted (12) - A response was successfully completed
  • icResponseReceived (8) - A response has been received

OK. I won't go through and describe them all, but I will point out some of the more useful ones. First of all, icConnected provides you with a failsafe way of knowing that you are connected to a remote machine. As icDisconnected also provides you with a way of knowing when you are offline. Probably the most useful constant is icError. This tells us that an error has occurred. We can now check using the ErrorConstants for the actual error that has occurred.

Page 2 of 4

This article was originally published on November 20, 2002

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date