Whenever you try to connect to connect to a Internet server while no Internet connection is present you can be almost certain an Access Violation will fire.
The only way around this is to check whether a connection is present or not. You can use the code below.
uses
Windows, SysUtils, Registry, WinSock, WinInet;
…
type
TConnectionType [...]
Merlin’s Delphi Forge