If you program is installed in the Program Files folder, then you should
NOT put any data files that need to be we written to (like a database)
in that directory, as it is a violation of Microsoft protection rules.
Only privileged programs  are allowed to write to files in the program
files directory tree.

That is the Windows UAC comment below. Depending on how the file is
accessed and how the program presents itself to the OS affects how the
virtualization works. As I remember, if the program acts old, Windows
will create a virtual version of the file (to maintain compatibility
with ancient programs written before the rule change), but if it acts
new, it gets the write permission error because it should know better.

On 8/10/18 9:43 PM, Lars Frederiksen wrote:
> Hi,
> Right now I am not by my PC so I am not able to show you the settings in my 
> FireDAC. Hovever I found some kind of solution to my problem before "closing 
> down" yesterday:
> A few days ago I created my flashcard.db database in the sqlite console prg 
> located in a folder named C:/SQLite/. From here it was copied to a folder 
> where my program exe-file is placed when I develop. Using flashcard.db from 
> this folder gave the mentioned error. After changing the connection link to 
> C:/SQLite/ the error disappeared and I was able to write to the database.
> I have to find out why it works like that!
>
> UNICODE problem:
> Besides this problem I have another one being not able to show greek 
> characters (unicode) when I insert records in the database. In the console 
> cmd-prompt the greek characters shows like questionmarks.
>  
> Best Regards
> Lars
>
> -----Oprindelig meddelelse-----
> Fra: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] PĂ„ 
> vegne af R Smith
> Sendt: 10. august 2018 20:06
> Til: sqlite-users@mailinglists.sqlite.org
> Emne: Re: [sqlite] [EXTERNAL] (no subject)
>
> On 2018/08/10 12:07 PM, Lars Frederiksen wrote:
>> In CMD I can write to my database without problems. Can you give me a hint 
>> about what might be wrong with my OS-setup in Windows 10?
>> Thank you for the answer and your help! Much appreciated!
> Usually the FireDAC connections work fine out the box, especially for 
> SQLite (though I suggest using your own latest DLL which can be 
> downloaded from sqlite.org).
>
> There are 2 typical reasons why a file can have locking difficulty in 
> Windows:
> 1 - Windows UAC is virtualizing the folder your DB is in (did you 
> perhaps put it in the same folder as the exe? Or any other 
> Windows-system folder?), or
> 2 - An over-zealous anti-virus is locking the file.
>
> Now I'm having difficulty believing it's 2, because the DB is not "Busy" 
> or erroring out when opening, it's "Read-Only" which isn't an automatic 
> switch for sqlite itself or via FireDAC.
>
> I'm also confident it's not 1 because the Windows UAC virtualization 
> could move the file, could even redirect to a folder where the file 
> doesn't exist, but I have never experienced it causing the file to open 
> in read-only mode in sqlite.
>
> This leaves only the FireDAC component itself. Perhaps it has read-only 
> mode set in either the properties or connection parameters - could you 
> post for us your exact set-up of the FireDac connection? (Just say which 
> controls you've used and their properties, view the form as text and 
> copy it if needed).
>
> Just to be sure it isn't the UAC, try and connect to an sqlite DB or 
> file in a safe location (such as your documents folder), see if you have 
> any luck.
>
> These things usually work rather easy and straight-forward - so I'm 
> betting it's something small that's perhaps not obvious.
>
>
> Cheers,
> Ryan
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


-- 
Richard Damon

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to