We help IT Professionals succeed at work.

Exception EInOutError in module.

Asw
Asw asked
on
Hi,

My application raised  an Exception EInOutError in module My.Exe at 00467988 I/O error 32.

I cannot seem to find any Info in the help files on error 32.
What is this error, and how do I handle it.

The error occurred when I clicked on a Db Navigator to insert a new record.

Asw
Comment
Watch Question

?
this is the function that creates that error

function CreateInOutError: EInOutError;
type
  TErrorRec = record
    Code: Integer;
    Ident: string;
  end;
const
  ErrorMap: array[0..6] of TErrorRec = (
    (Code: 2; Ident: SFileNotFound),
    (Code: 3; Ident: SInvalidFilename),
    (Code: 4; Ident: STooManyOpenFiles),
    (Code: 5; Ident: SAccessDenied),
    (Code: 100; Ident: SEndOfFile),
    (Code: 101; Ident: SDiskFull),
    (Code: 106; Ident: SInvalidInput));
var
  I: Integer;
  InOutRes: Integer;
begin
  I := Low(ErrorMap);
  InOutRes := IOResult;  // resets IOResult to zero
  while (I <= High(ErrorMap)) and (ErrorMap[I].Code <> InOutRes) do Inc(I);
  if I <= High(ErrorMap) then
    Result := EInOutError.Create(ErrorMap[I].Ident) else
    Result := EInOutError.CreateResFmt(@SInOutError, [InOutRes]);
  Result.ErrorCode := InOutRes;
end;

so your error was created by
Result := EInOutError.CreateResFmt(@SInOutError, [InOutRes]);

32 is unspecified IO error

do you have an open record or smth ???
can you debug it ?
put a breakpoint there and trace the error
Commented:
32 is ERROR_SHARING VIOLATION (file is open by another application) - declared in Windows.pas

Win32 error code listing can be found in win32.hlp (Delphi Help\Windows SDK menu), type 'error codes' in Index, select 'Error Codes (Win32 Programmer's Reference)'.

Perhaps you have written code in the dataset's BeforeInsert (or similar) event handler which attempts to open a file?
Or maybe you're trying to open a local table which is already open by another (or even your own ;-) process...

Can't say the exact cause but there's the error meaning.

HTH
TOndrej
Asw

Author

Commented:
Hi Guyz,
Thanks for your help, I will give the points to TOndrej Problem is ERROR_SHARING VIOLATION .

Asw