Windows socket error (10049)

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
gennadym
Posts: 1
Joined: Mon 28 Feb 2005 11:07

Windows socket error (10049)

Post by gennadym » Mon 28 Feb 2005 11:35

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.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Wed 02 Mar 2005 09:16

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.

jjeffman
Posts: 84
Joined: Tue 09 Nov 2004 12:22
Location: Porto Alegre-Rio Grande do Sul - Brazil

Windows socket error (10049)

Post by jjeffman » Tue 06 Apr 2010 15:20

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);
    }
  }

Post Reply