SQLite Permission Issue?

I have a SQLite db that I’m writing log entries to and I have a custom Xojo app that displays the log as it updates using a timer. When I run the log viewer app in the debugger it works fine. When I compile it and try to run it I have to ‘run as administrator’ in Win 10 to get it working. The Xojo app doesn’t prompt to be ran as administrator though, it just hangs up and barely responds. I could see it wasn’t reading from the local SQLite db so I tried running the app as Administrator as I have had similar issues with MS SQL Server but that is across a network connection and this SQLite db is located locally in the C:\ program files folder. Can anyone tell me why my app has trouble reading from the SQLite db? Could it be the location of the SQLite db that is causing the issue? Thanks!

Shouldn’t you store that database in your own folder within SpecialFolder.ApplicationData instead of trying to use the app’s folder? I think that should fix your permissions issue.

I thought that might be the issue but I wanted to make sure before I started working on it because it will be a lot of trouble for me to change all 3 of my apps and my installer script etc.

Thanks.

Looks like most of my questions are answered here:
https://forum.xojo.com/16854-administrator-with-windows/0

How can I return the string value of the Program Data folder like I can return the value of the exe and debug location using this code?

[code] Dim strAppPath As String

if DebugBuild Then
strAppPath = App.ExecutableFile.Parent.Parent.AbsolutePath
else
strAppPath = App.ExecutableFile.Parent.AbsolutePath
end

msgBox strAppPath[/code]

See the SpecialFolder module. Program Data is SpecialFolder.SharedApplicationData, so

msgbox SpecialFolder.SharedApplicationData.AbsolutePath

Thank you Tim sorry I had just figured it out and deleted my post because I didn’t think anyone had the time to see it.

Restore to the rescue! :slight_smile:

Yeah I was trying to stick Parent in there and it kept just giving me C:\

:confused:

Just a note LR says AbsolutePath is deprecated and to use NativePath instead.
http://documentation.xojo.com/index.php/FolderItem.NativePath