Click here to Skip to main content
16,017,319 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,

I need to develop a data based windows application, means the application just searches from a data structure and shows the output. I'm thinking to use Sqlite database. I'd attach the file while deployment.

Now the challenges are

-how to secure the database so that no one can open or delete it.
-how to give updates to the database, i don't want to replace the whole .db file.

Any suggestion or ideas would be thankful.
Posted
Comments
Kenneth Haugland 15-Jul-12 8:43am    
You could use a dataset and fill the table as a local copy...

1 solution

-how to secure the database so that no one can open or delete it.

You can't do don't even bother.

-how to give updates to the database, i don't want to replace the whole .db file.

Then write SQL scripts that modify the database appropriately. The problem is with sucessive updates, if someone tries to update the database to schema v3 and they didn't apply schema v2 update, your v3 update has to be cumulative, including the updates for v2 and the correct logic to tell the difference.
 
Share this answer
 
Comments
DEB4u 15-Jul-12 11:27am    
regarding security: A sqlite .db file can be opened in some sqlite browser, so how it can be secured?

Regarding update: let me be more specific,i.e. when i'll give update means the application will be updated like patches it'll install which may updated the database file.. or any other option?
Dave Kreskowiak 15-Jul-12 11:56am    
You cannot prevent someone from deleting the database file. It's that simple.

The problem with preventing users from looking at the database data is those exact same users have to be able to use the data in your application. When someone launches any application, it runs AS the user, not some mystical process that has more rights than the person who launched it.

As for updating the database, you either replace the database file with an updated version (overwriting customer data in the process) OR you supply a new database file and code to migrate customer data to the new database file (extra work!) OR you supply a SQL script to update the database schema leaving the database file in place. In all cases, you probably want to backup make a copy of the database file first before you start ANY operations on it.

There are no other options.
DEB4u 15-Jul-12 13:33pm    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900