Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET Sqlite
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 15-Jul-12 2:41am
DEB4u589
Comments
Kenneth Haugland at 15-Jul-12 8:43am
   
You could use a dataset and fill the table as a local copy...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

-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.
  Permalink  
Comments
DEB4u at 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 at 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 at 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)



Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 15 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100