1

Topic: At application with FireDac does not see a DB

Faced such problem - on the computer where I develop application at start all APPRX. Application - the unpretentious interface to DB Sqlite3. For communication I use driver FireDac. Accordingly I transfer application on other computer (a DB file in a folder, sqlite3.dll in a folder with application). At start I receive an error-Exception ESQLiteNativeExeption in module Project1.exe [FireDAC] [Phys] [SQLite] ERROR: unable to open database file.
What can it be? How to achieve an adequate application launch on other computer?
============
dr bond

2

Re: At application with FireDac does not see a DB

drbond wrote:

That it can be?

Normally phrase

drbond wrote:

unable to open database file.

it is translated as "It is impossible to open a database file"

drbond wrote:

How to achieve an adequate application launch on other computer?

to Rewrite on the computer a database

3

Re: At application with FireDac does not see a DB

_Vasilisk _, that's just the point, that the DB lies on the computer, in one folder with  and dll. And the way to a DB in FD.Connection is registered correctly.

4

Re: At application with FireDac does not see a DB

Way to basis register in run-time or design-time?

5

Re: At application with FireDac does not see a DB

AJi, a way I register in design-time in properties FD.Connection. Tried to register and in run-time in the output agent

procedure TMainForm. FDConnection1BeforeConnect (Sender: TObject);
begin
FDConnection1.Params. Values [' Database ']: = ' db3.db ';
end;

The same effect. By the machine with  environment all works correctly. By other machine it is not launched.

6

Re: At application with FireDac does not see a DB

drbond wrote:

By other machine it is not launched.

Miracles after all does not happen. If it is launched under the administrator the start folder changes, for example.
Check FileExists does not prevent or to register a full path to basis.

7

Re: At application with FireDac does not see a DB

drbond wrote:

AJi, a way I register in design-time in properties FD.Connection. Tried to register and in run-time in the output agent

procedure TMainForm. FDConnection1BeforeConnect (Sender: TObject);
begin
FDConnection1.Params. Values [' Database ']: = ' db3.db ';
end;

The same effect. By the machine with  environment all works correctly. By other machine it is not launched.

As already correctly noted, miracles do not happen. Specify a full path to a DB name. ExtractFilePath (Application. ExeName) + ' db3.db'
B look at property Active. It should be installed in false.

8

Re: At application with FireDac does not see a DB

wadman, I here so wrote now

procedure TMainForm. FDConnection1BeforeConnect (Sender: TObject);
begin
FDConnection1.Params. Values [' Database ']: = ExtractFilePath (ParamStr (0)) + ' db3.db ';
end;

The same effect.

9

Re: At application with FireDac does not see a DB

AJi, property connected costs in false. Property Active at requests too costs in false.

10

Re: At application with FireDac does not see a DB

AS. And except the program anybody another does not hold a DB file exclusively opened? An antivirus there or any database explorer?
sysinternals process explorer - run asadmin - search handle
And tangently immediately errors by program operation, sysinternals process monitor in teeth and to look a broad gull of file operations of the program, where exactly she tries to open a DB and what to it errors Windows returns

11

Re: At application with FireDac does not see a DB

Arioch wrote:

AS. And except the program anybody another does not hold a DB file exclusively opened? An antivirus there or any database explorer?
sysinternals process explorer - run asadmin - search handle
And tangently immediately errors by program operation, sysinternals process monitor in teeth and to look a broad gull of file operations of the program, where exactly she tries to open a DB and what to it errors Windows returns

Nobody holds a DB exclusively opened. With sysinternals process monitor yet did not work. I will try for the sake of curiosity. Thanks!

12

Re: At application with FireDac does not see a DB

drbond wrote:

Nobody holds a DB exclusively opened.

It as, two programs with SQLite can write to one DB SIMULTANEOUSLY?

13

Re: At application with FireDac does not see a DB

Arioch, did not understand a question. I wrote about that at the moment of attempt of discovery of a DB it is not occupied by any process.

14

Re: At application with FireDac does not see a DB

drbond;
If basis in program files the Windows change a way on programdata.
Use processmonitor to clarify, where the DB is searched.

15

Re: At application with FireDac does not see a DB

kdv wrote:

if basis in program files the Windows change a way on programdata.

Yes ! On users it changes
programdata == users\public\appdata - a special case

16

Re: At application with FireDac does not see a DB

The problem dared in the unexpected image - removed from form FDConnetcion, then again threw it on the form. And all earned. Here whose it is a glitch? FireDAC or development environments?

17

Re: At application with FireDac does not see a DB

drbond wrote:

And all earned. Here whose it is a glitch? FireDAC or development environments?

And monitoring systems of versions to compare files "to" and "after", certainly, there is no also you will be
Mum to swear that "any properties of a component did not change".

18

Re: At application with FireDac does not see a DB

Dimitry Sibiryakov wrote:

to compare files "to" and "after"

....In most Delphi there is an archive of last modifications

19

Re: At application with FireDac does not see a DB

Dimitry Sibiryakov;
So it also is. And what there to change? Simply at primary adjustment of a component selected SQLite, entered a way to a DB. Removed in properties a daw with LoginPrompt. Anything else did not change. The same made and at repeated layout of a component on the form. I basically do not sin on FireDAC. Now all works also me quite arranges. I want to understand the reason.

20

Re: At application with FireDac does not see a DB

drbond;
To compare DFM-files before and after
In Delphi scrap Beyond Compare and archive of the last savings for couple of weeks enters. Sm the tab history or a folder __ history

21

Re: At application with FireDac does not see a DB

drbond wrote:

With sysinternals process monitor yet did not work. I will try for the sake of curiosity.

What results were?

22

Re: At application with FireDac does not see a DB

Arioch, here a piece dfm from 02.08.18

object FDConnection1: TFDConnection
Params. Strings = (
' Database=db3.db'
' DriverID=SQLite ')
LoginPrompt = False
Transaction = FDTransaction1
BeforeConnect = FDConnection1BeforeConnect
Left = 168
Top = 16
end

Here a piece today's dfm

object FDConnection1: TFDConnection
Params. Strings = (
' Database=db3.db'
' DriverID=SQLite ')
LoginPrompt = False
Transaction = FDTransaction1
BeforeConnect = FDConnection1BeforeConnect
Left = 152
Top = 16
end

On August, 2nd the problem was. Today the problem disappeared.

23

Re: At application with FireDac does not see a DB

drbond;
And any other changes was not? The order of creation of components, for example, or properties at other components/forms?

24

Re: At application with FireDac does not see a DB

To check up easy, in general.
To put by today's DFM and to enclose instead of it from August, 2nd. Or the problem arises after that unique change, or is not present.
In the second case - business was in something the friend, in caches any, or in something
And the form "pure" or is inherited from other your form?