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 9 10372
On Wed, 17 Aug 2005 11:32:08 +0200, "Zlatko Matiæ"
<zl***********@sb.t-com.hr> wrote:
You are doing it right in the first code block, but if I ever see you
late bind you DAO, you'll get a spanking :-)
DAO has nothing to do with Access perse; it is a standalone object
model to work with a Jet database, that happens to be embraced by
Access.
Use a technique not because you just read about it, but because you
have a need. Typically late binding is used with somewhat obscure
objects that you can't be sure exist on the user's computer, and where
you have the option to "gracefully degrade" your app if the object was
not found. DAO is not such an object, nor could you likely gracefully
degrade your app if it was not found.
-Tom. 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
Hi, Tom!
In fact the only reason why I was looking about late binding is because I
want to distribute .mde to users with different Office versions. I didn't
experience problems with DAO references, but ADO (msado15.dll), by the way.
So, my question could be asked also for ADO objects (connection object,
recordset object, command object...) as well as for DAO or any other
libraries.
I just couldn't find any true example of late binding in Access. Does
anybody use it in real life, after all? Or it is just hipothetical
possibility ?
If it is not common practice, how people solve problems concerning
compatibility on different Office versions ?
It is maybe not a big problem if you distribute .mdb, so every user can
adjust references, but it is not possible in .mde...
How do you solve references problem in .mde ?
Greetings,
Zlatko
"Tom van Stiphout" <no*************@cox.net> je napisao u poruci interesnoj
grupi:gp********************************@4ax.com.. . On Wed, 17 Aug 2005 11:32:08 +0200, "Zlatko Matiæ" <zl***********@sb.t-com.hr> wrote:
You are doing it right in the first code block, but if I ever see you late bind you DAO, you'll get a spanking :-) DAO has nothing to do with Access perse; it is a standalone object model to work with a Jet database, that happens to be embraced by Access. Use a technique not because you just read about it, but because you have a need. Typically late binding is used with somewhat obscure objects that you can't be sure exist on the user's computer, and where you have the option to "gracefully degrade" your app if the object was not found. DAO is not such an object, nor could you likely gracefully degrade your app if it was not found.
-Tom.
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
Zlatko Matic wrote: Hi, Tom! In fact the only reason why I was looking about late binding is because I want to distribute .mde to users with different Office versions. I didn't experience problems with DAO references, but ADO (msado15.dll), by the way. So, my question could be asked also for ADO objects (connection object, recordset object, command object...) as well as for DAO or any other libraries. I just couldn't find any true example of late binding in Access. Does anybody use it in real life, after all? Or it is just hipothetical possibility ? If it is not common practice, how people solve problems concerning compatibility on different Office versions ? It is maybe not a big problem if you distribute .mdb, so every user can adjust references, but it is not possible in .mde... How do you solve references problem in .mde ?
I would hazard a guess that for developers that know what there doing that
late binding is overwhelmingly used instead of early binding. I would NEVER
use early binding except in cases where there is absolute control over the
software that is installed (and isn't installed) on the target PCs. Late
binding is just too darned easy to implement to risk any chance of
versioning problems and broken references that early binding inevitably
produces.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
On Thu, 18 Aug 2005 21:22:44 +0200, "Zlatko Matic"
<zl***********@sb.t-com.hr> wrote:
I use it quite regularly. For example in an app that uses Msft
MapPoint to draw a map. It's no big deal if you don't have MapPoint
installed; you'll just not have the "View as Map" button.
With regards to Office: let's assume that your app uses Word to
generate some letters, and that the user MUST have Office2000 or
better installed. Then write your code in Access 2000, with Word 2000
reference selected. You write early-binding code. If your app is
installed on a computer with a higher version of Office, the reference
will AUTOMATICALLY be "upgraded" to Word XP, Word 2003, etc. That's
the power of OLE for you.
-Tom. Hi, Tom! In fact the only reason why I was looking about late binding is because I want to distribute .mde to users with different Office versions. I didn't experience problems with DAO references, but ADO (msado15.dll), by the way. So, my question could be asked also for ADO objects (connection object, recordset object, command object...) as well as for DAO or any other libraries. I just couldn't find any true example of late binding in Access. Does anybody use it in real life, after all? Or it is just hipothetical possibility ? If it is not common practice, how people solve problems concerning compatibility on different Office versions ? It is maybe not a big problem if you distribute .mdb, so every user can adjust references, but it is not possible in .mde... How do you solve references problem in .mde ?
Greetings,
Zlatko
"Tom van Stiphout" <no*************@cox.net> je napisao u poruci interesnoj grupi:gp********************************@4ax.com. .. On Wed, 17 Aug 2005 11:32:08 +0200, "Zlatko Matiæ" <zl***********@sb.t-com.hr> wrote:
You are doing it right in the first code block, but if I ever see you late bind you DAO, you'll get a spanking :-) DAO has nothing to do with Access perse; it is a standalone object model to work with a Jet database, that happens to be embraced by Access. Use a technique not because you just read about it, but because you have a need. Typically late binding is used with somewhat obscure objects that you can't be sure exist on the user's computer, and where you have the option to "gracefully degrade" your app if the object was not found. DAO is not such an object, nor could you likely gracefully degrade your app if it was not found.
-Tom.
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
Hi, Rick.
So, could you tell me what is wrong with this part of code:
Dim ws As Object
Set ws = CreateObject("DAO.Workspace")
Dim db As Object
Set db = CreateObject("DAO.Database")
Dim qdf As Object
Set qdf = CreateObject("DAO.QueryDef")
Dim qdfSQL As String
Dim rs As Object
Set rs = CreateObject("DAO.Recordset")
On Error GoTo GRESKA
DoCmd.Hourglass True
Set ws = DBEngine(0)
Set db = CurrentDb
.....
When I execute this function, an error apears: "ActiveX component can't
create an object".
I suppose it is something regarding CurrentDb or DBEngine (0) ? How to open
current database using late binding ?
If you regulary use late binding yould you give me some example of DAO lata
binding ?
Thanks in advance,
Zlatko
"Rick Brandt" <ri*********@hotmail.com> je napisao u poruci interesnoj
grupi:%T*****************@newssvr17.news.prodigy.c om... Zlatko Matic wrote: Hi, Tom! In fact the only reason why I was looking about late binding is because I want to distribute .mde to users with different Office versions. I didn't experience problems with DAO references, but ADO (msado15.dll), by the way. So, my question could be asked also for ADO objects (connection object, recordset object, command object...) as well as for DAO or any other libraries. I just couldn't find any true example of late binding in Access. Does anybody use it in real life, after all? Or it is just hipothetical possibility ? If it is not common practice, how people solve problems concerning compatibility on different Office versions ? It is maybe not a big problem if you distribute .mdb, so every user can adjust references, but it is not possible in .mde... How do you solve references problem in .mde ?
I would hazard a guess that for developers that know what there doing that late binding is overwhelmingly used instead of early binding. I would NEVER use early binding except in cases where there is absolute control over the software that is installed (and isn't installed) on the target PCs. Late binding is just too darned easy to implement to risk any chance of versioning problems and broken references that early binding inevitably produces.
-- I don't check the Email account attached to this message. Send instead to... RBrandt at Hunter dot com
"Zlatko Matiæ" <zl***********@sb.t-com.hr> wrote in
news:de**********@ss405.t-com.hr: When I execute this function, an error apears: "ActiveX component can't create an object". I suppose it is something regarding CurrentDb or DBEngine (0) ? How to open current database using late binding ? If you regulary use late binding yould you give me some example of DAO lata binding ?
Why in the world are you trying to do DAO with late binding? That's
a ridiculously crazy thing to do.
Keep in mind that CurrentDB is both a DAO function and a property of
the Access.Application object. This might give you the ability to do
lots of DAO even without a DAO reference, but I wouldn't know.
Removing the DAO reference seems to me like intentionally cutting
off your legs just before you try to run a marathon.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
OK., maybe it is crazy, but still I have my reasons...
Is it possible or not ? If yes, how to achieve late binding of DAO objects ?
"David W. Fenton" <dX********@bway.net.invalid> je napisao u poruci
interesnoj grupi:Xn**********************************@216.196 .97.142... "Zlatko Matiæ" <zl***********@sb.t-com.hr> wrote in news:de**********@ss405.t-com.hr:
When I execute this function, an error apears: "ActiveX component can't create an object". I suppose it is something regarding CurrentDb or DBEngine (0) ? How to open current database using late binding ? If you regulary use late binding yould you give me some example of DAO lata binding ?
Why in the world are you trying to do DAO with late binding? That's a ridiculously crazy thing to do.
Keep in mind that CurrentDB is both a DAO function and a property of the Access.Application object. This might give you the ability to do lots of DAO even without a DAO reference, but I wouldn't know. Removing the DAO reference seems to me like intentionally cutting off your legs just before you try to run a marathon.
-- David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc
"Zlatko Matiæ" <zl***********@sb.t-com.hr> wrote in
news:de**********@ss405.t-com.hr: OK., maybe it is crazy, but still I have my reasons... Is it possible or not ? If yes, how to achieve late binding of DAO objects ?
I don't know, and I really couldn't give a rat's ass if it *is*
possible, because it's just about the stupidist thing I've ever
heard of anyone attempting to do.
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Hello.
This weekend I succeded to achieve late binding of both DAO and ADO. After I
moved references away, everything worked just good and couldn't see any
significant performance decrease...
Greetings,
Zlatko
"David W. Fenton" <dX********@bway.net.invalid> je napisao u poruci
interesnoj grupi:Xn**********************************@216.196 .97.142... "Zlatko Matiæ" <zl***********@sb.t-com.hr> wrote in news:de**********@ss405.t-com.hr:
OK., maybe it is crazy, but still I have my reasons... Is it possible or not ? If yes, how to achieve late binding of DAO objects ?
I don't know, and I really couldn't give a rat's ass if it *is* possible, because it's just about the stupidist thing I've ever heard of anyone attempting to do.
-- David W. Fenton http://www.bway.net/~dfenton dfenton at bway dot net http://www.bway.net/~dfassoc This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mike MacSween |
last post by:
Had some trouble with Word automation. Sorted it, in the process thought I
would try late binding. Some people reccomend it. So this:
*********************************************************...
|
by: JD Kronicz |
last post by:
Hi .. I have an issue I have been beating my head against
the wall on for some time. I am trying to use late
binding for MS graph so that my end users don't have to
worry about having the right...
|
by: Composer |
last post by:
I've read many postings about the problem of Access.References.IsBroken
and the consensus seems to be that late binding is the cure-all.
I have a very complex Access application that needs...
|
by: eBob.com |
last post by:
In another thread VJ made me aware of Tag. Fantastic! I've been
wanting this capability for a long time. But it seems that I cannot
use it with Option Strict On. In an event handler I have ......
|
by: lgbjr |
last post by:
hi All,
I've decided to use Options Strict ON in one of my apps and now I'm trying
to fix a late binding issue. I have 5 integer arrays:
dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
|
by: Tim Roberts |
last post by:
I've been doing COM a long time, but I've just come across a behavior
with late binding that surprises me. VB and VBS are not my normal
milieux, so I'm hoping someone can point me to a document...
|
by: GS |
last post by:
I have installed the ms PIA for ofc XP, and followed the article
http://support.microsoft.com/kb/247412/
trying to paste into a worksheet
However I got late binding not allowed errors
.......
|
by: ADezii |
last post by:
The process of verifying that an Object exists and that a specified Property or Method is valid is called Binding. There are two times when this verification process can take place: during compile...
|
by: Siv |
last post by:
hi,
I am converting an application that writes to an Excel spreadsheet and the
code trips the "option Strict" that I would like on because the parser says
"option Strict On disallows late...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |