Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

I'm thinking specifically of the application installation program (InstallShield, etc) that installs a Windows application that connects to an SQL Anywhere database.

[CommonAppDataFolder]\MyCompany\MyProduct seems to make sense and I've seen that recommended but that folder is not visible to users by default. The user may need to get at that database file to make a copy of it or send it to a colleague.

I'm guessing that putting the database in "Program Files" is frowned upon.

Is there a Sybase recommendation or best practice? I'm curious how people are doing this.

Thank you.

asked 06 Aug '10, 13:33

Integrated%20Login's gravatar image

Integrated L...
accept rate: 0%

First, placing files in the "Profile Files" tree is definitely not the thing to do because in recent versions of Windows (starting with Vista) Microsoft disallows modification of files in PF when UAC is turned on.

Chris Jackson (from Microsoft's 'SWAT' team) has blogged about this topic here and the quick answer is "it depends".

If the database is specific to a single user on the computer, then putting the database in the user's Document folder may be the solution for you. If the database is not specific to a user then using the Public's Document folder may be the place.

An alternative is to hide the file away in the %ALLUSERSPROFILE folder and provide a method within your application for the user to "get a copy" or "restore a copy" of the file. This way the user would not need to know where the file is actually being kept and the user can store the "copy" where ever they like.

permanent link

answered 06 Aug '10, 13:58

Mark%20Culp's gravatar image

Mark Culp
accept rate: 41%

Thanks Mark. I've read the Chris Jackson article and it really only muddies the waters. What if the file is not specific to a single user? It should be in a folder that is shared for all users...LOL like in the good old XP days. There does not seem to be a place for it. I'm asking here because there must be hundreds of developers that ship databases with their applications. There must be a best practice.

(06 Aug '10, 18:07) Integrated L...

I have to say that my inclination is to put it right outside anything that Windows does or (may in the future do) funny stuff with. There is now so much "virtulisation" of folders that goes on that you can end up with a terrible mess.

We had a case where someone put the db in a Vista folder that they thought was shared. This was a single user system, but different users logged onto the machine. They couldn't understand why they couldn't see each others changes. It turned out that Windows had given them each their own copy of the db file!

If at all possible I would put the db on a separate disk (physical if poss) from the OS.

permanent link

answered 06 Aug '10, 15:40

Justin%20Willey's gravatar image

Justin Willey
accept rate: 20%

Yes if it's a custom install agreed...but I need a standard place to put it for a common widespread app.

(06 Aug '10, 18:04) Integrated L...

@Install - agreed, but I would be wary about putting it inside any windows standard folder structure these days. I'd love to be proved wrong, but I'm not convinced that there is anywhere that's safe. Messy I know, but I would be tempted to create your own folder structure off the route of the drive chosen by the user / or failing that off the root of the primary drive.

(06 Aug '10, 20:35) Justin Willey
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 06 Aug '10, 13:33

question was seen: 2,275 times

last updated: 06 Aug '10, 15:40