title: Microsoft Access 2010 - Recompile with new connectionString after db name and extension change
body: <p>I have this old Access database (2000 format) which i want to convert to the new .accdb 2007 format. I know just basic stuff about Access so I knew it was a bit of a challenge, I decided to do it anyway.</p>
  
  <p>It has two files, one appears to have all the tables "WOSS_Tables.mdb" (duh), the other ("WOSS.mdb") has a bunch of Forms and a Module and lots of code when I go to Database Tools / Visual Basic.</p>
  
  <p>I opened them both in Access 2010 and did a  "Save and Publish", "Save ass .accdb" and everything went fine with that.</p>
  
  <p>So the first thing that pops up when I open the WOSS.mdb is a Login Form, but when i try to log in it says:</p>
  
  <p><a href="https://i.stack.imgur.com/RD1Eh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RD1Eh.png" alt="Error message"></a>
  </p>
  
  <p>So i get it, it does not find the new file. 
  Digging into the WOSS.mdb file (Now WOSS.accdb) i find a Module which has sort of a connectionString named ruta (route in spanish), so i changed it, pointing it to my desktop for now:</p>
  
  <pre><code>Option Compare Database
  Option Explicit
  
  Public xdescripcion As String
  '** Ruta para abrir la base de datos
  'Public Const Ruta = "\\the_super_secret_old_route\"
  Public Const Ruta = "C:\Users\AlexXPS\Desktop\Woss"
  Public M
  </code></pre>
  
  <p>And found on a bunch of Forms, lines like these:</p>
  
  <pre><code>Set dbs = DBEngine.Workspaces(0).OpenDatabase(Ruta + "WOSS_Tables.mdb", False, False, "")
  Set dbs = OpenDatabase(Ruta + "WOSS_Tables.mdb", False, False, "")
  </code></pre>
  
  <p>Updated those with "WOSS_Tables.accdb" aswell.</p>
  
  <p>Now, I click Save, then Debug menu, Compile  then i close and reopen and i still get the same error as above, like it didnt compile at all?</p>
  
  <p>If i check the Forms and the Module code, its like i changed it Ruta is correctly pointing at my desktop and the other changes were saved correctly aswell.</p>
  
  <p>So, what am i doing wrong?</p>
  
  <p>PS: Sorry for the long post :(  </p>
  
  <hr>
  
  <p><strong>EDIT!!!!!!!</strong></p>
  
  <p>Okay, messing around with the code i found something out:</p>
  
  <p>On the Logon screen theres a ComboBox which is supposed to show all the UserNames in the Users table, the ComboBox has a simple query on its "Row Source" Data Property</p>
  
  <pre><code>SELECT DISTINCTROW [Usuarios].[Name], [Usuarios].[Name] FROM Usuarios ORDER BY [Usuarios].[Name]; 
  </code></pre>
  
  <p>Which has nothing to do with the "Ruta" variable I changed!</p>
  
  <p>So now the question is, how can I tell that ComboBox that the location of its source db changed? (Its not "\the_super_secret_old_route\WOSS_Tables.mdf" anymore, its "C:\Users\AlexXPS\Desktop\Woss/WOSS_Tables.accdb")</p>
  
  <p>The previous error message was shown because of the ComboBox not finding the database :), not the other code (Which of course also needed to be changed)</p>
  
  <p>I hope im explaining myself well, if not, heres a screenshot!</p>
  
  <p><a href="https://i.stack.imgur.com/BN3u1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BN3u1.png" alt="Properties Window of ComboBox"></a>
  </p>