Access vs xml

bones

Well-known member
Joined
Aug 23, 2014
Messages
143
Programming Experience
Beginner
I'm at the point in my new app where I need to decide on saving the data. What are the pros and cons of saving data as .xml vs sending it from a datatable to an access table?
 
I would say that two of the main considerations are the amount and nature of the data you want to store. A relational database will be superior if there is a lot of data and/or there are a number of relations within that data. If you just have a few bits of unrelated data to store then XML will do fine. Also, a database is also going to be more efficient if you want to be able to query the data in any but the most rudimentary way. There are tools to work with XML but they will not be as efficient as databases, which have years of optimisation behind them.
 
Thank you both for your replies. With regard to using xml I have the following question. If I go that route, I need a location for the saved data in the code. Can I create a new folder in the project and point the save function there? Will that folder be visible through the system file structure...eg. My computer\c:\myapp\data? Or will it only be available from within the code in the application? Dumb question right....but this is my first VB project and I don't honestly know the answer. Don't want to start coding things and end up saying...OH Crap...didn't realize that... :lookaroundb:
 
Thank you both for your replies. With regard to using xml I have the following question. If I go that route, I need a location for the saved data in the code. Can I create a new folder in the project and point the save function there? Will that folder be visible through the system file structure...eg. My computer\c:\myapp\data? Or will it only be available from within the code in the application? Dumb question right....but this is my first VB project and I don't honestly know the answer. Don't want to start coding things and end up saying...OH Crap...didn't realize that... :lookaroundb:
You should pretty much avoid storing writeable data under the program folder because some users will not have write permission on that location. You can use the Environment.GetFolderPath method or the My.Computer.FileSystem.SpecialDirectories object to get various standard paths at run time, some of which are guaranteed to be writeable for all users.
 
Back
Top