Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between early binding and late
binding?

Answers were Sorted based on User's Feedback



What is the difference between early binding and late binding?..

Answer / murugesh

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 time (Early Binding) or run time
(Late Binding). When you declare an Object Variable as a
specific Data Type, you are using Early Binding so the
verification can take place during compile time. When you
declare a Variable of the generic Object Data Type, you are
using Late Binding. In this case, VBA must find and verify
the Object information during any execution of VBA
statement that includes a Reference to the Object or one of
its Properties or Methods. The time difference between
Early and Late Binding can be quite significant. Some
examples of Early Binding are listed below:
Dim appAccess As Access.Application
Dim appExcel As Excel.Application
Dim winExcel As Excel.Window
Dim winProject As Project.Window
Dim chkBox As CheckBox
Dim cboFinance As ComboBox
Dim chtMain As Chart
Dim lstLookup As ListBox
Dim pvtNew As PivotTable
As an example, I'll refer to an ADO Field as an ADODB.Field
and also as an Object (commented out). Benchmark Test
Procedures using the code below report a hugh difference in
the speed of accessing the ADO Field's Properties,
naturally, in favor of Early Binding. The code is listed
below.

Code: ( text )
Dim rst As ADODB.Recordset, strName As String

'Early Binding. Declaring fld as ADODB.Field results in
'times that are around 7% of those measured declaring fld
'as Object. In the case of several hundred Records, the
difference
'would not be significant, but in the case of several
hundred
'thousand Records, the time difference would be enormous.
Dim fld As ADODB.Field

'Late Binding
'Dim fld As Object

Set rst = New ADODB.Recordset
Set rst.ActiveConnection = CurrentProject.Connection
rst.Source = "tblEmployee"
rst.CursorType = adOpenStatic

rst.Open

rst.MoveFirst

Set fld = rst.Fields(0)
Do While Not rst.EOF
strName = fld.Name
rst.MoveNext
Loop

rst.Close
Set fld = Nothing
Set rst = Nothing

In every case, if at all possible, declare a Variable using
the most specific Object Type that you can. For Access
Controls, that means using, for example:

Code: ( text )
Dim cmd As CommandButton

Is This Answer Correct ?    15 Yes 7 No

What is the difference between early binding and late binding?..

Answer / divit kumar

Late binding is implemented when you do not know which function will be called, though early binding is faster then latebinding.
(Early Binding is also called static binding or compile time binding)
(Late Binding is also called dynamic binding or runtime binding)
danishvbr[at]yahoo.com
.
.
Early binding determines execution path at compilation and late binding allows for dynamic execution at runtime.
for example: In a native Win32 code environment (i.e., non .NET), late binding could refer to the use of a DLL library vs. the use of a static library - all the references in a static library can be determined at compile time, but the references in a DLL (dynamic link library) are not determined later until run time. In a .NET environment, late binding could refer to the use of System.Reflection

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More Visual Basic Interview Questions

Is it possible to call oracle database through ADO control or Object?

0 Answers  


What is executenonquery in vb net?

0 Answers  


Types of cursors in DAO?

0 Answers  


___,_____ and ____ container objects. ___ Property is to compress a image in image control. ___,___ and __ are difference between image and picture controls. To set the command button for ESC ___ Property has to be changed. ___,__,___ are the type of combo box? __ no of controls in form. OLE is used for _______ ___ is the control used to call a windows application. Clear property is available in ____,___ control. ___ Property is used to count no. of items in a combobox. ___ is a property to resize a label control according to your caption. ___ property is used to change to ___ value to access a identity column'in datacontrols. _____ is the property to ___,____,____ are valid for recordsource property of dat control. Timer control contains ________ no. of events. ____ property is used to lock a textbox to enter a datas. ____ is the difference between Listindex and Tab index. ____ property of menu cannot be set at run time. _____ collection in recordset used to assign a value from textbox to table columns without making abinding in datacontrol. ___ argument can be used to make a menuitem into bold. ___,___ arguments will be used to run a executable program in shell function ___ property used to add a menus at runtime. ___ VB constant make the menu item in centre. ___ method used to move a recordset pointer in nth position in DAG.

1 Answers   TCS,


Explain about literals?

0 Answers  


What is the use of NEW Keyword Explain?

2 Answers  


What is the latest version of visual basic?

0 Answers  


What is the use of Visual Basic Document file?

0 Answers  


Give brief description about class?

0 Answers  


what are the Control Categories?

1 Answers  


Which ADO object is used to perform commit / rollback ? Is it command or connection or recordset I am not sure of the options given. So please let me know the answer if it is something else.

4 Answers   Infosys,


What is the use of command Object?What are the various types of variables?

0 Answers  


Categories