#1 2011-10-02 14:01:45

Phisatho
Member
Registered: 2011-07-24
Posts: 21

Woes with attach database

My woes with attach database continues. I am not able to attach a non-existent database.
Same case as :memory: as mentioned in the encryption thread. I believe both issues are related as a memory database does not exist when attached.
As this not related to encryption, I thought I will rather start a new thread.
I tried both codes below:

DBsUser.ExecuteNoResult('ATTACH DATABASE ? AS Savefile;', [UserFileName]);

and

     QRsUser.Prepare('ATTACH DATABASE ? AS Savefile;');
         QRsUser.BindTextS(1, UserFileName);
         QRsUser.ExecutePrepared;

both results in the error:
'SQL logic error or missing database.'

Offline

#2 2011-10-02 15:32:28

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,258
Website

Re: Woes with attach database

Please post some code to reproduce the issue.

ATTACH expects an existing database, and a new to be attached.

Offline

#3 2011-10-08 11:02:20

Phisatho
Member
Registered: 2011-07-24
Posts: 21

Re: Woes with attach database

Sorry for the delay in replying as I was away fort a week.
Now I found the problem with my program logic which prevented the attach statement from executing in certain situations. Now it is working OK.
I am still puzzled with :memory:. Let me test it a few more times before reporting.

Sorry for the inconvenience.

Offline

Board footer

Powered by FluxBB