 <p>Starting with Steve B's comment and later finding this <a href="http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/67c417e8-cf39-4ae2-928c-2b4f709b146d" rel="nofollow">article</a>, I solved my problem doing the following:</p> <ol> <li>On the user machine, the database is copied into the <code>%AppData%</code> directory.</li> <li>The <code>|DataDirectory|</code> is dynamically changed between Debug and Release mode.</li> </ol> <p>This allows not to change the connection string.</p> <p>In the meantime, I opted for a MS Access *.accdb database, but here is my code anyway.</p> <pre><code>Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load #If (Not Debug) Then pathMyAppData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) &amp; "\MyApp" '"DataDirectory" is used in the Connection String AppDomain.CurrentDomain.SetData("DataDirectory", pathMyAppData) 'The application closes if no database is found If Not File.Exists(pathMyAppData &amp; "\MyDB.accdb) Then MsgBox("Database not found. Program closes.", MsgBoxStyle.Critical, "Error") Me.Close() End If #End If </code></pre>