Link to home
Start Free TrialLog in
Avatar of Don Gravitt
Don Gravitt

asked on

I inherited an 2003 Accesss mdb file and have tried to covert to accdb. Converting the file presents issues with the VBA code.

It appears that a lot of the older VBA code doesn't run under the new version. Does all this code repair have to be handled manually, or is there a conversion that can be ran on all projects so it's not such a manual process?
Avatar of Juan Ocasio
Juan Ocasio
Flag of United States of America image

It should convert.  I think the only issue would be if you have user level security.  Did you check the references to make sure they're all aligned with what you had in the mdb?
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Don Gravitt
Don Gravitt

ASKER

Thanks. The recordset change seems to be the biggest issue. I'm doing a search and replace now.
<< The recordset change seems to be the biggest issue. I'm doing a search and replace now. >>

 While it is a good idea to do that, you really don't have to.   You just need to reference DAO and make sure ADO is un-checked.

If you are using both, then you'll be better off to be explicit and use DAO.

Reason is that both DAO and ADO have a recordset object, but are not the same.   When you reference just Recordset, it will stop at the first lib reference which contains that object, which may or may not be the correct one.

Jim.
Thanks again!
When it comes to upgrading an old .mdb to a .accdb, there are several things to be aware of:
-If you are just simply moving everything to a .accdb, then there shouldn't be too much to do.
-If you are going from a 32-bit Windows machine to 64-bit Windows, the you are going to need to add "PtrSafe" to any API declarations.
-Make sure you have no missing references in the VBA.  Replace old, missing references with their modern equivalent, or change the code so you don't need them.
-If you want to have your app work in 32-bit and 64-bit, then you are going to need conditional compilation.
-Old apps were prone to use a lot of components like ActiveX controls and other things that are now "defunct" and won't work.  You'll need to remove them.
-If you are switching to a SQL Server backend and will be using ADO, then you'll need to specify the recordset as DAO or ADODB.  If you're not using ADODB and don't plan to, then no need for DAO.Recordset.  The whole issue there is that both DAO and ADODB have an object called a "Recordset", so you need to specify which one you are using if there is a chance you may use both in your app.
-.accdb's have the built in date picker that is available on date field bound or date formatted controls, but you can't have an input mask - that kills the date picker.