问题
i am trying to add this to my code :
Dim myRS1 As DAO.Recordset
yet it gives me this error:
Compile error: user-defined type not defined
I have gone through these links:
- compile error: user-defined type not defined
- Compiler Error: User-defined types not defined
- What is "Compile error User-defined type not defined"?
- w7 -> VB6 error "User-defined type not defined"
- http://www.tek-tips.com/viewthread.cfm?qid=1731794
Yet to no avail.
I have tried adding the Microsoft Access 3.6
library yet then it says Error in loading DLL
I don't understand, my previous projects use the exact same code yet they work completely fine.
回答1:
I guess we are taking about Access 2003 here. In the Visual Basic windows, menu 'Tools > References' having ticked & selected 'Microsoft DAO 3.6 Object Library', it should show the location of the DLL at the bottom of the form. It will be something like:
C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL
Check that DLL, and associated files exist. Compare the folders contents with another working PC, and copy across files as necessary. (Always take backup of original state.) The error 'Error in loading DLL' may indicate a corrupted DLL.
Also check the 'Object Browser', in the Visual Basic windows, menu 'View > Object Browser'. You should able to select the 'DAO' library in the Top Combo, and then browse it's Classes & Members.
来源:https://stackoverflow.com/questions/49169591/ms-access-compile-error-user-defined-type-not-defined