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.
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.
I opened them both in Access 2010 and did a “Save and Publish”, “Save ass .accdb” and everything went fine with that.
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:
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:
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
And found on a bunch of Forms, lines like these:
Set dbs = DBEngine.Workspaces(0).OpenDatabase(Ruta + "WOSS_Tables.mdb", False, False, "")
Set dbs = OpenDatabase(Ruta + "WOSS_Tables.mdb", False, False, "")
Updated those with “WOSS_Tables.accdb” aswell.
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?
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.
So, what am i doing wrong?
PS: Sorry for the long post 🙁
EDIT!!!!!!!
Okay, messing around with the code i found something out:
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
SELECT DISTINCTROW [Usuarios].[Name], [Usuarios].[Name] FROM Usuarios ORDER BY [Usuarios].[Name];
Which has nothing to do with the “Ruta” variable I changed!
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”)
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)
I hope im explaining myself well, if not, heres a screenshot!


Look again at the change you made to the Ruta constant.
Notice the previous version ended with a backslash; the new version doesn’t. So in your
OpenDatabase()statements, you’re giving the full path to the database like this …or maybe it’s like this with your other changes …
Either way, it seems you’re missing a backslash before the file name.
Edit: Your updated question indicates you have this as the row source for a combo box:
Open the navigation pane, right-click its header, then choose Navigation Options … Place a check mark in the box next to Show Hidden Objects. Then verify there is a linked table named Usuarios. You’ll need to update the location of the db which contains the actual Usuarios source table. Do that by selecting the Database Tools section of the ribbon, then choose Linked Table Manager to update the link’s location.
Edit2: You can examine the
.Connectproperty of the Usuarios link to determine the location of the db file which contains the source table.That way you might be able to get rid of the Ruta constant and avoid the need to update that constant and the name of the database file everywhere your code calls
OpenDatabase(). Just use the Linked Table Manager to update the links when the file name or location changes, then rely on theBackEndLocation()function to tell your code where it its.