Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
429 views
in Technique[技术] by (71.8m points)

vba - dao.recordset2 and dao.field2 not usable. I got compilation error

I just start to work with VBA on Access and I just want to use this type : recordset2 and field2. My aim is to work with attachment. But I got a compilation error when I try to run this :

Dim oRst As DAO.Recordset2
Dim rs As DAO.Recordset2
Dim fld As DAO.Field2

I got alike error

"undefined user-defined type"

and i don't know why. All the code I read use this types. What have i misunderstood ?

question from:https://stackoverflow.com/questions/65917465/dao-recordset2-and-dao-field2-not-usable-i-got-compilation-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You probably have a reference to an old DAO library. You need this reference:

Microsoft Office 16.0 Access database engine Object Library


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...