Z
Zlatko Matiæ
I was reading about late binding, but I'm not completely sure what is to be
done in order to adjust code to late binding...
For example, I'm not sure if this is correct:
early binding:
Dim ws As DAO.Workspace
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs As DAO.Recordset
late binding:
Dim ws as Object
Set ws =CreateObject("DAO.Workspace")
Dim ws as Object
Set db =CreateObject("DAO.Database")
Dim qdf as Object
Set qdf =CreateObject("DAO.QueryDef")
Dim rs as Object
Set rs =CreateObject("DAO.Recordset")
VBA help says that class argument inside Create object function has to be in
appname.objecttype format. Does it means that "DAO" should be preceded by
"Access", so the previous code should be like this:
Dim ws as Object
Set ws =CreateObject("Access.DAO.Workspace")
Dim ws as Object
Set db =CreateObject("Access.DAO.Database")
Dim qdf as Object
Set qdf =CreateObject("Access.DAO.QueryDef")
Dim rs as Object
Set rs =CreateObject("Access.DAO.Recordset")
?
What exactly I need to change in my code in order to support "late binding"
?
All examples given in VBA help and internet are concerning late binding in
case of calling other Office aplication from Access, but I couldn't find
examples of late binding inside Access itself...so I'm little bit confused.
Is there any Add-in or program, that can change early binding declarations
to late binding declarations through all modules automaticcally ?
Zlatko
done in order to adjust code to late binding...
For example, I'm not sure if this is correct:
early binding:
Dim ws As DAO.Workspace
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs As DAO.Recordset
late binding:
Dim ws as Object
Set ws =CreateObject("DAO.Workspace")
Dim ws as Object
Set db =CreateObject("DAO.Database")
Dim qdf as Object
Set qdf =CreateObject("DAO.QueryDef")
Dim rs as Object
Set rs =CreateObject("DAO.Recordset")
VBA help says that class argument inside Create object function has to be in
appname.objecttype format. Does it means that "DAO" should be preceded by
"Access", so the previous code should be like this:
Dim ws as Object
Set ws =CreateObject("Access.DAO.Workspace")
Dim ws as Object
Set db =CreateObject("Access.DAO.Database")
Dim qdf as Object
Set qdf =CreateObject("Access.DAO.QueryDef")
Dim rs as Object
Set rs =CreateObject("Access.DAO.Recordset")
?
What exactly I need to change in my code in order to support "late binding"
?
All examples given in VBA help and internet are concerning late binding in
case of calling other Office aplication from Access, but I couldn't find
examples of late binding inside Access itself...so I'm little bit confused.
Is there any Add-in or program, that can change early binding declarations
to late binding declarations through all modules automaticcally ?
Zlatko