Page 1 of 1

Windows socket error (10049)

Posted: Mon 28 Feb 2005 11:35
by gennadym
I am using:

ODAC 5.50 (there was the same problem using version 3.50)
Delphi 5
Oracle 8.1.7 (RH Linux 8.0)
NET-connection (clientless)

On connection I get an exception:

Windows socket error: (10049) on API 'connect'

NET: Invalid host

Using firewall, I traced connection port and address:

TCP: 32769
addr: 0.0.0.0

But there are no such problems when I connect to Oracle 8.1.7 installed on Windows box.

Posted: Wed 02 Mar 2005 09:16
by Paul
The problem is in addr: 0.0.0.0. ODAC cannot establish connection to this host. Additionally, some problems may occur when using firewall. Oracle determines arbitrary port number for establishing connection. You must configure MTS dispatcher on Oracle server to use single IP address.

Windows socket error (10049)

Posted: Tue 06 Apr 2010 15:20
by jjeffman
Hello.

I am getting the same error, but I know the host I am trying to connect to is unavailable. I would like just catch the exception to give to the application user a way of setting the correct host name and perform the connection.

I am using the code bellow. Can someone give a clue?

//(ODAC v 6.90 - Database is a TOraSession component )

Code: Select all

  try { Database->Connect(); lResult = Database->Connected; }
  catch(EOraError *E)
  {
    switch(E->ErrorCode)
    {
      case 28000:
        msgText = "Este usuário está bloqueado!" ;
        break;
      case 28001: // senha expirada
      case 28002: // senha prestes a expirar
        if(FAutoChangePassword)
        {
          //Database->ConnectPrompt = false;
          try {Database->Password = ChangePassword(Database->Password);}
          catch(EOraError *E){ msgText = E->Message ; }
        }
        break;
      case 01004:
      case 01005:
        msgText = "Usuário e senha devem ser especificados!" ;
        break;
      case 01014:
        msgText = "Servidor Oracle em 'shutdown' !" ;
        break;
      case 01017:
        msgText = "Usuário / Senha incorretos\n\nVerifique se 'Caps Lock' não está ativado !" ;
        break;
      default :
        msgText = "Não foi possível conectar ao banco de dados!" ;
    }
    if(!msgText.IsEmpty())
    {
      Application->MessageBox(msgText.c_str(), Application->Title.c_str(),MB_ICONERROR);
    }
  }