Board index » delphi » Win32 error 10038

Win32 error 10038

Hi,

I'm trying to create a new user via TIBSecurityService but I'm getting the
following message:

"Cannot connect to host "HostName"
 Win32 error 10038"

What could be wrong ?

PS: The project I'm working with and the IBServer are in the same machine.

TIA,

Mrcio Barroso

 

Re:Win32 error 10038


What are you using for the ServerName and Protocol properties?

--
Bill
(TeamB cannot answer questions received via email)

Re:Win32 error 10038


Hi Bill,

the following procedure creates a new user:

procedure TfrmCriaUsuario.bbInclusaoClick(Sender: TObject);
var
  aNome: array[0..MAX_COMPUTERNAME_LENGTH + 1] of char;
  c: cardinal;
  bErro: boolean;
begin

  c := MAX_COMPUTERNAME_LENGTH + 1;
  GetComputerName(aNome,c);
  IBSecurity.ServerName := StrPas(aNome);

// Check if the user already exists

  with IBSecurity do
    begin
    Active := True;
    DisplayUser('PONTO');
    if UserInfo[0] <> nil then
      begin
      MessageDlg('Usurio padr?o j existe',mtInformation,[mbOk],0);
      Active := False;
      Close;
      Exit;
    end;
    Active := False;
  end;//with

  bErro := False;

// Creates a new user

  try
    with IBSecurity do
      begin
      UserName := 'PONTO';
      Password := 'pwrd';
      Active := True;
      try
        AddUser;
      finally
        Active := False;
      end; //try
    end; //with
  except
    bErro := True;
    MessageDlg('Problemas na cria??o do usurio padr?o',mtError,[mbOk],0);
  end;//try
  if not bErro then
    MessageDlg('Usurio criado com sucesso',mtInformation,[mbOk],0);
  Close;
end;

Bill Todd (TeamB) <bill_nos...@dbginc.com> escreveu nas notcias de
mensagem:3c8947d5$1_1@dnews...

Quote
> What are you using for the ServerName and Protocol properties?

> --
> Bill
> (TeamB cannot answer questions received via email)

Re:Win32 error 10038


Hi Bill,

Quote

   I use the TCP Protocol

Quote
> the following procedure creates a new user:

> procedure TfrmCriaUsuario.bbInclusaoClick(Sender: TObject);
> var
>   aNome: array[0..MAX_COMPUTERNAME_LENGTH + 1] of char;
>   c: cardinal;
>   bErro: boolean;
> begin

>   c := MAX_COMPUTERNAME_LENGTH + 1;
>   GetComputerName(aNome,c);
>   IBSecurity.ServerName := StrPas(aNome);

> // Check if the user already exists

>   with IBSecurity do
>     begin
>     Active := True;
>     DisplayUser('PONTO');
>     if UserInfo[0] <> nil then
>       begin
>       MessageDlg('Usurio padr?o j existe',mtInformation,[mbOk],0);
>       Active := False;
>       Close;
>       Exit;
>     end;
>     Active := False;
>   end;//with

>   bErro := False;

> // Creates a new user

>   try
>     with IBSecurity do
>       begin
>       UserName := 'PONTO';
>       Password := 'pwrd';
>       Active := True;
>       try
>         AddUser;
>       finally
>         Active := False;
>       end; file://try
>     end; file://with
>   except
>     bErro := True;
>     MessageDlg('Problemas na cria??o do usurio padr?o',mtError,[mbOk],0);
>   end;//try
>   if not bErro then
>     MessageDlg('Usurio criado com sucesso',mtInformation,[mbOk],0);
>   Close;
> end;

Marcio Barroso <desen...@dinamicasist.com.br> escreveu nas notcias de
mensagem:3c8cac7f$1_1@dnews...

Re:Win32 error 10038


10038 is a winsock error, "An operation was attempted on something that is
not a socket. The specified socket parameter refers to a file, not a
socket." If the IB server is running on the same machine that your program
is running on I do not see any reason why your code should not work.

--
Bill
(TeamB cannot answer questions received via email)

Other Threads