Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Access 97 (w/lots of VBA code) to 2000 - HELP!! 3

Status
Not open for further replies.

raf

Programmer
Apr 10, 2000
14
US
I have a 2/3 done project in Access 97 with lots of VBA code. I have imported everything into Access 2000. I get compiler errors on just about every form at
dim db as Database
I've browsed the help system, and it seems I will have to recode tons of stuff.

Is everyone doing this? Is there an easy way?

What are most people doing? Converting or sticking with 97?

[sig][/sig]
 
Hi raf,

for what it's worth ive been through this with
access2 -> access97,

generally it follows that methods are "slightly" different between versions. also i have found (painfully) that it is best to re-evaluate the project for the new version, this allows you to take advantage of the "new features" a facet i'm not looking forward to with the code base i have deployed!

if the project works in version x and the client is happy stick with it, if they wish to upgrade it's a whole new ball game X-)

see ya
Robert [sig][/sig]
 
First of all becasue VBA is a spearate program in Access 2000 it does not understand anything without adding references to it.
So open something in Access with VBA in it to launch the VBA program.
Next click the "Tools" menu and click "References"
You need to Check (click the little box in front of) these 5 things.

Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft DAO 3.6 Object Library <<<< Probably the one you need
OLE Automation
Microsoft Visual Basic for Applications Extensibility 5.3

You may have some already
Look down that long list they are in there make sure you get the correct version like 3.6 cause there may be several that have 3.0 or 3.5 etc.
[sig]<p>DougP, MCP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.[/sig]
 
also everytime you use dim As Database or As Recordset

you need to change to

As DAO.Database and As DAO.Recordset


PaulF [sig][/sig]
 
Doug is absolutely on the correct track but didn't mention the 'MISSING' reference issue. I contacted Microsoft about this years ago and this problem is causing nightmares for people. They explained that when the application is being started it will try to identify all the libraries needed for the application. They do this by programmatically checking the references for the application. These references may not be correct for any number of reasons. Anyway, when they are not able to resolve a reference it is tagged as missing and the search for libraries is stopped. So all the references to libraries past any listed as 'missing' are unresolved and can't be used. Normally that ends up with Access showing code errors on standard Access type objects which have been used forever. The Database, Recordset, etc. Hope this helps.

If you receive an error such as &quot;Undefined Function,&quot; &quot;Function not available in query expressions,&quot; or you can't find the object or property you're looking for, then you probably lost some of your library references when you last upgraded. Fortunately, problems with missing references are easy to resolve. Simply open a module or the VB Editor and select References... from the Tool menu. Check the listing in the Available References control. If you find one tagged &quot;Missing,&quot; uncheck it. Then, from the Debug menu choose Compile and Save All Modules or Compile VBAProject. Doing so should locate and reestablish your missing references.
 
I also experienced similar problems when converting Access 2.0 to Access 97. In fact, if you have any tables linked to another database, it is important that you also define the workspace for that database if you directly open the table programmatically.

The previous response was also correct that the compilation stops as it reviews the libraries. The only way around this problem is to start with a clean database and import one module and one function at a time. If you call other functions in other modules, comment them out until you begin to isolate the function calls that are causing you the problem.

I will also be converting Access 97 code to Access 2000 sometime this year. All of these comments have been excellent, and no, you're not the only one.

Good Luck.

Scott.
 
Maybe I was too long winded. If you have a missing reference and you uncheck the missing reference in tools\references your problem will be corrected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top