Delphi fails to open database

645 Views Asked by At

Windows 32, Delphi XE5. Database from Component ACE: Absolute database.

Form Create Procedure worked ok upto few hours ago. Suddenly resulted in error:

Cannot open File"Error Code 3" Error message: Can not find the path specified. Error 30364.

I have read many discussion with the same or similar problem but none gave me a good hint to solve. The Procedure code is:

Procedure TForm1.FormCreate(Sender: TObject);
 begin
   ABSDatabase1.DatabaseFilename:= ExtractFilePath(Application.ExeName)+'LibCat.ABS';
   ABSDatabase1.Open;
   // showmessage(ABSDatabase1.Databasefilename);
   ABSTable1.TableName:='Cat';
   ABSTable1.Open;   // gives error
   ABSTable1.Last;
   GetAppVersionStr;
   Form1.Caption:=Form1.Caption +': Books Catalogue, ver. ' + Versione;
 end;

The database file is in the same folder as the Project exe file. Any path of the option file point to the same folder.

I cannot imagine what modication I did to get this error.

On a step by step debugging the Database opens regularly, but the open Table gives the error. On Object Inspector for Database the FileName is specified as .\LibCat.abs

1

There are 1 best solutions below

0
Manlio On

Solved. It was really a silly reason: I examined carefully the .dfm file and I found that on "Object Inspector" providing data to ABSDatabase1 I have written the name and put at the end of the string a carriage return and a new line. Of course these characters where not visible on ID, only on .dfm file. I do not know why this additional keys caused the error, but as I cleared them the Form was regularly generated and the program run perfectly. Hope this can be useful to someone else.