luke2012 Well-Known Member Licensed User Longtime User Mar 26, 2012 #1 Hi to all, there is a way to replace a db file copied with this function with a updated db file ? TargetDir = DBUtils.CopyDBFromAssets("my.db") SQLEngine.Initialize(TargetDir, "my.db" , False)
Hi to all, there is a way to replace a db file copied with this function with a updated db file ? TargetDir = DBUtils.CopyDBFromAssets("my.db") SQLEngine.Initialize(TargetDir, "my.db" , False)
barx Well-Known Member Licensed User Longtime User Mar 26, 2012 #2 the 'false' at the end means that if the file already exists it won't be overwritten. Set this this to true and it will. Bear in mind though that this will overwrite the file and not merge it so any data in existing will be lost. I.e. any records added since install. Upvote 0
the 'false' at the end means that if the file already exists it won't be overwritten. Set this this to true and it will. Bear in mind though that this will overwrite the file and not merge it so any data in existing will be lost. I.e. any records added since install.
Erel B4X founder Staff member Licensed User Longtime User Mar 27, 2012 #3 Actually the last parameter is CreateIfNecessary. If you set it to false and the database file doesn't exist you will get an error. It never overwrites an existing database. You can modify CopyDBFromAssets sub and change its behavior to copy the file even if the target file exists. Upvote 0
Actually the last parameter is CreateIfNecessary. If you set it to false and the database file doesn't exist you will get an error. It never overwrites an existing database. You can modify CopyDBFromAssets sub and change its behavior to copy the file even if the target file exists.
luke2012 Well-Known Member Licensed User Longtime User Mar 27, 2012 #4 Thanks for the support! Upvote 0
barx Well-Known Member Licensed User Longtime User Mar 27, 2012 #5 Bugger. I really must stop giving out bad info. Sorry. I'd modified dbutils on my system to add another parameter for overwriting db so I could overwrite when id made modification. Note to self: check info is correct before posting. Lol Sent from my HTC Vision using Tapatalk Upvote 0
Bugger. I really must stop giving out bad info. Sorry. I'd modified dbutils on my system to add another parameter for overwriting db so I could overwrite when id made modification. Note to self: check info is correct before posting. Lol Sent from my HTC Vision using Tapatalk