Question : Dim db1 as database; suddenly "database" becomes user defined type

Hi,

I use MS Access 2000;

If I install a new button in a working form and assign the subroutine to it, the following could happen:

the statement

DIM db1 as

and usually, if you input the "space" you get a list of choice for the type, which could be inputted, in this case
I would like to have "database"; but this type is no longer in the list; if I input it manually and then compile
I get the error, that "database" is a user defined type.

This is a strange behaviour, because:
1. If I have a database (mdb), which contains the type under question ("database") I could install the new button without any problems.

2. But it could also happen, that the "healthy" database could loose the type "database" when trying to install a new button.

And then with no means I can get it back to the "old" state.

This behaviour is obviously coupled to the database; I reinstalled MS ACCESS without changing the behaviour.
I can copy the mdb to a PC with Windows NT 4.0 and there is the same behaviour.

So obviously the error is fixed to the mdb, and it is portable (from Windows XP Prof to Windows NT 4.0).

Details on the Version:
On Windows XP Prof SP 2.0
MS Access 2000 9.0.6926 SP-3
VB 6.0 Vers. 8967; retail 6.0.8714 Forms3: 2.01

On Windows NT 4.0 Sp6
MS Access 2000 9.0.2812
VB 6.0 Vers. 8435; retail 6.0.8435 Forms3: 2.01

German versions




My question:

Has anybody an idea, what could cause the error?
The development of a new application for me now is very uncertain, because without knowing the reason, I can throw away my newly implemented functions and start over from an erlier version of the mdb, which does not show the error (until ... )

Thank you in advance for your help

Dieter



Answer : Dim db1 as database; suddenly "database" becomes user defined type

You need to add references

Tools -> References
Then make sure "Microsoft DAO 3.x Object Library" is CHECKED.
Random Solutions  
 
programming4us programming4us