Pregunta

i have a windows desktop application deployed correctly, i use the setup project of visual studio, the access database is included within the content files with the permanent property, so if the user update the application the database will remain intact, my concern is about the best approach to update my access database if i want to add, modify or delete a field. I have read about custom actions but im new to that kind of scripting, is this the best approach?

¿Fue útil?

Solución

Personally I have chosen another path. I have a simple XML file like this

<Scripts>
   <Script>
      <Progression>1</Progression>
      <Command>DROP PROCEDURE MyObsoleteQuery</Command>
   </Script>
<Scripts>

At every new release of the application, a new copy of this file is distributed with a simple copy overwriting the previous file.

At startup of my application (but I could also use a separate executable), I load this file in a DataTable to find the latest Progression number available inside the script file.

In the database I have a table that keep just one record with the last 'Progression' executed against this copy of the database.

At this point I check the two numbers and execute all the Script missing to reach the last one in the XML file and update the internal table with the last Progression executed.

Of course this is a very simplified explanation of the whole real process where a robust error checking is in place to be sure that not one single Progression script would be missed

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top