1. Difference Between Flexgrid and Dbgrid
Sno
Flex Grid
Dbgrid
1
Readonly
Read/Write
2
Cannot be linked with Database
Can be linked with database through datasource property
3
Can hold pictures and images
Only text can be stored
2.What is ActiveX and what are the types of ActiveX
An ActiveX component is a unit of executable code, such as an .exe, .dll, or .ocx file, that follows the ActiveX specification for providing objects. ActiveX technology allows prosgrammers to assemble these reusable software components into applications and services. Activex Control,Activex DLL, Activex Document,Activex Exe,Activex Document Dll,Activex Document Exe
3.Advantage of Activex Dll over Activex Exe
Sno
Activex Dll
Activex Exe
1
An in-process component, or ActiveX DLL, runs in another application’s process. The client may be the application itself, or another in-process component that the application is using.
An out-of-process component, or ActiveX EXE, runs in its own address space
2
Cannot run independently
Can run independently
4. Advantages of disconnected Recordsets and where it is useful
A disconnected recordset is a recordset that has been disconnected from its original connection. The recordset can then be efficiently marshaled between components without maintaining a connection. These are useful when passing data between components in a three-tiered architecture. To build a disconnected recordset, you need to define the CursorLocation as adUseClient before opening the recordset, then open and build the recordset, and then disconnect using
Set rs.ActiveConnection = Nothing.
NOTE: If you are using MaxRows, a disconnected recordset will not know how to get the next set of rows.
5. Difference between Image and Picture Controls
Sno
Image Control
Picture Control
1
Cannot act as container to other controls
Can act as a container for other controls and support for graphics methods.
2
Can stretch the image to fit the size of the control
Picture box control cannot stretch the image to fit the size of the control. To make a picture box control automatically resize to display an entire graphic, set its AutoSize property to True.
3
Does not support graphic methods
Picture boxes, like forms, can be used to receive the output of graphics methods such as Circle, Line, and Point. For example, you can use the Circle method to draw a circle in a picture box by setting the control's AutoRedraw property to True.
6. Define Container objects
A Container object groups similar types of Document objects together.
The following table lists the name of each Container object defined by the Microsoft Jet database engine and what type of information it contains.
Container name
Contains information about
Databases
Saved databases
Tables
Saved tables and queries
Relations
Saved relationships
7. What are the types of combo box
There are three combo box styles. Each style can be set at design time and uses values, or equivalent Visual Basic
constants, to set the style of the combo box.
Style
Value
Constant
Drop-down combo box
0
VbComboDropDown
Simple combo box
1
VbComboSimple
Drop-down list box
2
VbComboDropDownList
8.Shell function and arguments of shell function
Runs an executable program and returns a Variant (Double) representing the program's task ID if successful,
otherwise it returns zero.
Shell(pathname[,windowstyle])
vbHide 0 Window is hidden and focus is passed to the hidden window.
vbNormalFocus 1 Window has focus and is restored to its original size and position.
vbMinimizedFocus 2 Window is displayed as an icon with focus.
vbMaximizedFocus 3 Window is maximized with focus.
VbNormalNoFocus 4 Window is restored to its most recent size and position. The currently active window remains active. VbMinimizedNoFocus 6 Window is displayed as an icon. The currently active window remains active.
9. Benfits of using MTS
Microsoft Transaction Server (MTS) simplifies managing component and interface security by using roles. A role is a symbolic name that defines a logical group of users for a package of components. Roles determine which users are allowed to invoke interfaces in a component. A role is similar to the idea of user groups in Windows NT.
MTS security also uses the concept of packages. Packages are groups of in-process components (DLLs) that compose your application's business services. You can configure security for the package and not the individual components. This makes the administration of component access much easier. All components in a package run with the same security.
10.Binary Access Method in file Acess
Binary access allows you to use files to store data however you want. It is similar to random access, except there are no assumptions made about data type or record length. However, you must know precisely how the data was written to the file to retrieve it correctly.
11.Can you create tabletype of recordset in Jet_connected ODBC database engine?
Tabletype Recordset objects are used to manipulate data in a database at the record level. You can create a table-type Recordset object from a base table of a Microsoft Jet database, but not from an ODBC or linked table. You can use the table-type Recordset object with ISAM databases (like FoxPro, dBASE, or Paradox) when you open them directly.
12. What are the controls that have Clear Property?
ListBox, Combo Box, or the system Clipboard.
13. Controls which do not have Events?
Shape controls
14.Default Lock type for DAO
When working with Microsoft Jet-connected ODBC data sources, the LockEdits property is always set to False, or optimistic locking
15. In process vs Out Process. Which is faster?
Components are characterized by their location relative to clients. An out-of-process component is an .exe file that runs in its own process, with its own thread of execution. Communication between a client and an out-of-process component is therefore called cross-process or out-of-process communication.
An in-process component, such as a .dll or .ocx file, runs in the same process as the client. It provides the fastest way of accessing objects, because property and method calls don’t have to be marshaled across process boundaries. However, an in-process component must use the client’s thread of execution.
16. Difference between Function and Subroutine?
A Sub procedure differs from a Function procedure in that a Sub procedure cannot be called by using its name within an expression. A call to a Sub is a stand-alone statement. Also, a Sub does not return a value in its name as does a function. However, like a Function, a Sub can modify the values of any variables passed to it.
There are two ways to call a Sub procedure:
' Both of these statements call a Sub named MyProc.
Call MyProc (FirstArgument, SecondArgument)
MyProc FirstArgument, SecondArgument
Note that when you use the Call syntax, arguments must be enclosed in parentheses. If you omit the Call keyword, you must also omit the parentheses around the arguments.
Usually, you call a function procedure you've written yourself the same way you call an intrinsic Visual Basic function like Abs; that is, by using its name in an expression:
' All of the following statements would call a function
' named ToDec.
Print 10 * ToDec
X = ToDec
If ToDec = 10 Then Debug.Print "Out of Range"
X = AnotherFunction(10 * ToDec)
It's also possible to call a function just like you would call a Sub procedure. The following statements both call the same function:
Call Year(Now)
Year Now
When you call a function this way, Visual Basic throws away the return value.
17. Difference Between Class modules and Standard Modules
s.No
Class Module
Standard Module
1
Classes can be instantiated
Modules cannot be instantiated
2
Classes can implement interfaces
Modules cannot implement interfaces
3
Members defined within a class are scoped within a specific instance of the class, and exist only for the lifetime of the object
Members declared within a standard module, on the other hand, are shared by default, and are scoped to the declaration space of the standard module's containing namespace. This means that public variables in a standard module are effectively global variables because they are visible from anywhere in your project, and they exist for the life of the program.
18. Types of Recordset DAO Object?
1. Table_Type
2. Dynaset
3. Snapshot
4. Forward only
5. Dynamic
Representation in code of a base table that you can use to add, change, or delete records from a single database table (Microsoft Jet workspaces only).
the result of a query that can have updatable records. A dynaset-type Recordset object is a dynamic set of records that you can use to add, change, or delete records from an underlying database table or tables. A dynaset-type Recordset object can contain fields from one or more tables in a database. This type corresponds to an ODBC keyset cursor.
a static copy of a set of records that you can use to find data or generate reports. A snapshot-type Recordset object can contain fields from one or more tables in a database but can't be updated. This type corresponds to an ODBC static cursor.
identical to a snapshot except that no cursor is provided. You can only scroll forward through records. This improves performance in situations where you only need to make a single pass through a result set. This type corresponds to an ODBC forward-only cursor.
a query result set from one or more base tables in which you can add, change, or delete records from a row-returning query. Further, records other users add, delete, or edit in the base tables also appear in your Recordset. This type corresponds to an ODBC dynamic cursor (ODBCDirect workspaces only).
19. Difference between DDE and OLE
S.No
DDE (Dynamic Data Exchange)
OLE (Object Linking and Embedding)
1
When using DDE, both the source application and the destination application must be running at the same time in order for exchange of data to occur.
Unlike DDE, OLE allows a Windows application to run inside another Windows application. Eg: Excel can be opened from the vb itself
Difference between Linking and Embedding?
When using OLE, the object can be either embedded or linked. The difference between the two options is where the
object is stored and the impact of the change to the object thereafter.
S.no
Linking
Embedding
1.
When linked, only a pointer to the original object created and stored in the source application is stored in the container application
When embedded, the object is stored in the container application
2.
changes can be made to the object without affecting the original object created and stored in the source application, and vice visa
changes can be made.by using the menu and/or tools provided by the source application to the object stored in the source application
3.
Editing the embedded object by double-click the object is called in-place activation (or visual editing). In this case, the toolbar and menu bar of the container application are substituted (partly, at least) for those of the source application.
Double-clicking the linked object always open a new window created by the source application
21.Difference between Listbox and Combo box?
s.no
List Box
Combo Box
1
list box is appropriate when you want to limit input to what is on the list
a combo box is appropriate when there is a list of suggested choices
2.
A combo box contains an edit field, so choices not on the list can be typed in this field.
Editing is not possible
How does Querydef differ from Recordset?
querydef objects may be more efficient. For example, use a stored query of an SQL string as an argument to the
recordset of querydef to produce a filtered dynaset or snapshot instead of creating a dynaset or snapshot and then filtering it .
querydef objects do not store data. They store the definition of a query used to retrieve data. querydefs can be created
only on a Microsoft Access or Visual Basic database . querydefs require a name.
You must supply a name for the query when you create it
22. Difference between Recordset and Resultset
Recordset is used to retrive datas from DAO or ADO
Reultset from RDO
23.Different types of Instancing property in Activex Dll and Exe?
The value of the Instancing property determines whether your class is private - that is,
for use only within your component - or available for other applications to use.
Private means that other applications aren’t allowed access to type library information about the class, and cannot create instances of it. Private objects are only for use within your component.
PublicNotCreatable means that other applications can use objects of this class only if your component creates the
objects first. Other applications cannot use the CreateObject function or the New operator to create objects from the class.
MultiUse allows other applications to create objects from the class. One instance of your component can provide any number of objects created in this fashion. An out-of-process component can supply multiple objects to multiple clients;
an in-process component can supply multiple objects to the client and to any other components in its process.
GlobalMultiUse is like Multiuse, with one addition: properties and methods of the class can be invoked as if they were simply global functions. It’s not necessary to explicitly create an instance of the class first, because one will automatically be created.
SingleUse allows other applications to create objects from the class, but every object of this class that a client creates starts a new instance of your component. Not allowed in ActiveX DLL projects.
GlobalSingleUse is like SingleUse, except that properties and methods of the class can be invoked as if they were simply global functions. Not allowed in ActiveX DLL projects.
24. Does Vb Support OOPS Concept - Yes vb supports OOPS concept.
25. Modal and Moduless Windows in vb?
A modal dialog box must be closed (hidden or unloaded) before you can continue working with the rest of the application
Modeless dialog boxes let you shift the focus between the dialog box and another form without having to close the dialog box. You can continue to work elsewhere in the current application while the dialog box is displayed. Modeless dialog boxes are rare. From the Edit menu, the Find dialog box in Visual Basic is an example of a modeless dialog box
26. Lock Edit Type Property in RDO
Constant
Value
Description
RdConcurReadOnly
1
Default) Cursor is read-only. No updates are allowed.
RdConcurLock
2
Pessimistic concurrency.
RdConcurRowVer
3
Optimistic concurrency based on row ID.
RdConcurValues
4
Optimistic concurrency based on row values.
RdConcurBatch
5
Optimistic concurrency using batch mode updates. Status values returned for each row successfully updated.
27. Types of views in Listview Control
Large (standard) Icons
Small Icons
List
Report
28. OLE Drag Drop
The ability to drag text or graphics from one control to another, or from a control to another Windows application,
and vice versa. OLE drag-and-drop allows you to add this functionality to your applications.
With OLE drag and drop, you’re not dragging one control to another control to invoke
some code (as with the drag and drop discussed earlier in this chapter); you’re moving data
from one control or application to another control or application. For example, you can select and
drag a range of cells in Excel and then drop the range of cells into a DataGrid control in your application.
29. Ado Objects
Object
Description
Connection
Enables exchange of data.
Command
Embodies an SQL statement.
Parameter
Embodies a parameter of an SQL statement.
Recordset
Enables navigation and manipulation of data.
Field
Embodies a column of a Recordset object.
Error
Embodies an error on a connection.
Property
Embodies a characteristic of an ADO object.
30.Types of Cursors in ADO Recordset
Dynamic cursor-allows you to view additions, changes, and deletions by other users, and allows
all types of movement through the Recordset that don't rely on bookmarks;
allows bookmarks if the provider supports them.
Keyset cursor-behaves like a dynamic cursor, except that it prevents you from seeing records t
hat other users add, and prevents access to records that other users delete. Data changes by
other users will still be visible. It always supports bookmarks and therefore allows all types
of movement through the Recordset.
Static cursor-provides a static copy of a set of records for you to use to find data or generate reports;
always allows bookmarks and therefore allows all types of movement through the Recordset. Additions,
changes, or deletions by other users will not be visible. This is the only type of cursor allowed
when you open a client-side (ADOR) Recordset object.
Forward-only cursor-behaves identically to a dynamic cursor except that it allows you to scroll only forward through records. This improves performance in situations where you need to make only a single pass through a Recordset.
31. Property Bag
A PropertyBag object holds information that is to be saved and restored across invocations of an object
32.Property LET,GET,SET ?
Visual Basic provides three kinds of property procedures, as described in the following table.
Procedure
Purpose
Property Get
Returns the value of a property.
Property Let
Sets the value of a property.
Property Set
Sets the value of an object property (that is, a property that contains a reference to an object).
33.File Access Types in vb
Sequential - For reading and writing text files in continuous blocks.
Random - For reading and writing text or binary files structured as fixed-length records.
Binary - For reading and writing arbitrarily structured files.
34. How will you check Beginning and End of File?
Using BOF and EOF
35. Types of Data Access Controls?
The ADO Data control
DataList control
DataCombo control
DataGrid control
Microsoft Hierarchical FlexGrid control
36. File System Controls?
DriveListBox
DirListBox
FileListBox
37. How to register a component?
Regsvr32 filepath.
38. How would you display column headers in list view control
Add method to add a ColumnHeader object to the ColumnHeaders collection.
39. How would you add elements to Treeview control
A "tree" is comprised of cascading branches of "nodes," and each node typically consists
of an image (set with the Image property) and a label (set with the Text property).
Images for the nodes are supplied by an ImageList control associated with the TreeView control.
40.Steps in creating Activex control
Determine the features your control will provide.
Design the appearance of your control.
Design the interface for your control - that is, the properties, methods, and events your control will expose.
Create a project group consisting of your control project and a test project.
Implement the appearance of your control by adding controls and/or code to the UserControl object.
Implement the interface and features of your control.
As you add each interface element or feature, add features to your test project to exercise the new functionality.
Design and implement property pages for your control.
Compile your control component (.ocx file) and test it with all potential target applications.
41.Steps in Creating Active X Dll and Exe
Active X Dll
Determine the features your component will provide.
Determine what objects are required to divide the functionality of the component in a logical fashion.
Design any forms your component will display.
Design the interface - that is, the properties, methods, and events - for each class provided by your component.
Create a project group consisting of your component project and a test project.
Implement the forms required by your component.
Implement the interface of each class.
As you add each interface element or feature, add features to your test project to exercise the new functionality.
Compile your DLL and test it with all potential target applications.
ActiveX Exe
Determine the features your component will provide.
Determine what objects are required to divide the functionality of the component in a logical fashion.
Design any forms your component will display.
Design the interface - that is, the properties, methods, and events - for each class provided by your component.
Create a separate test project, usually a Standard Exe project.
Implement the forms required by your component.
Implement the interface of each class.
As you add each interface element or feature, add features to your test project to exercise the new functionality.
Compile your Exe and test it with all potential target applications.
42.Property Page
The base object used to create an ActiveX Property Page.
Property pages provide an alternative to the Properties window for viewing properties. You can group several
related properties on a page, or use a page to provide a dialog-like interface for a property that’s too
complex for the Properties window. A PropertyPage object represents one page, which is to say one tab
in the Property Pages dialog box.
43. Tab Index in Label Control
Frame and Label controls) remain in the tab order but are skipped during tabbing.
Menu, Timer, Data, Image, Line and Shape controls, which are not included in the tab order
44. Zorder Method
Places a specified MDIForm, Form, or control at the front or back of the z-order within its graphical level
Three graphical layers are associated with forms and containers. The back layer is the drawing space where
the results of the graphics methods are displayed. Next is the middle layer where graphical objects and Label controls
re displayed. The front layer is where all nongraphical controls like CommandButton, CheckBox, or ListBox are
displayed. Anything contained in a layer closer to the front covers anything contained in the layer(s) behind it.
ZOrder arranges objects only within the layer where the object is displayed.
45. Data Form Wizard
The Data Form Wizard is designed to automatically generate Visual Basic forms that contain individual
bound controls and procedures used to manage information derived from database tables and queries
You can use the Data Form Wizard to create either single query forms to manage the data from a single
table or simple query, or Master/Detail type forms used to manage more complex one-to-many data relationships.
If you are using a control, you can also create a grid or datasheet type form. The Data Form Wizard is used in
conjunction with only the ADO Data control.
46.Use of Immediate Window
Use the Immediate window to:
Test problematic or newly written code.
Query or change the value of a variable while running an application. While execution is halted, assign the variable
a new value as you would in code.
Query or change a property value while running an application.
Call procedures as you would in code.
View debugging output while the program is running.
47. Uses Imagelist control
An ImageList control contains a collection of images that can be used by other Windows Common Controls -
specifically, the ListView, TreeView, TabStrip, and Toolbar controls. For example, the ImageList control can store
all the images that appear on a Toolbar control's buttons.
Using the ImageList control as a single repository saves you development time by allowing you to write code
that refers to a single, consistent catalog of images. Instead of writing code that loads bitmaps
or icons (using the LoadPicture function), you can populate the ImageList once, assign Key
values if you wish, and write code that uses the Key or Index properties to refer to images.
48. Uses of Progress Bar Control
To inform the user of progress as a file transfer occurs over a network.
To reflect the state of a process that takes more than a few seconds.
To inform the user of progress as a complex algorithm is being calculated.
49.Scale Height , Scale Width Property
Return or set the number of units for the horizontal (ScaleWidth) and vertical (ScaleHeight) measurement
of the interior of an object when using graphics methods or when positioning controls. For MDIForm objects,
not available at design time and read-only at run time.
You can use these properties to create a custom coordinate scale for drawing or printing. For example,
the statement ScaleHeight = 100 changes the units of measure of the actual interior height of the form
50. QueryUnload and Unload Events in form
This event is typically used to make sure there are no unfinished tasks in the forms included in an application
before that application closes. For example, if a user has not yet saved some new data in any form, your application can prompt the user to save the data.
When an application closes, you can use either the QueryUnload or Unload event procedure
to set the Cancel property to True, stopping the closing process. However, the
QueryUnload event occurs in all forms before any are unloaded, and
Unload event occurs as each form is unloaded.
51. ADO compared with RDO and DAO
ADO is the successor to DAO/RDO. Functionally ADO 2.0 is most similar to RDO,
and there's generally a similar mapping between the two models. ADO "flattens" the
object model used by DAO and RDO, meaning that it contains fewer objects and more properties,
methods (and arguments), and events. For example,
ADO has no equivalents to the rdoEngine and rdoEnvironment objects,
which exposed the ODBC driver manager and hEnv interfaces.
Nor can you currently create ODBC data sources from ADO,
despite the fact that your interface might be through the ODBC OLE DB service provider.
52.WorkSpace / Default Workspace
A Workspace object defines a named session for a user. It contains open databases
and provides mechanisms for simultaneous transactions and, in Microsoft Jet workspaces,
secure workgroup support. It also controls whether you are going through the Microsoft Jet database engine
or ODBCDirect to access external data.
Default WorkspaceThe Workspace object that DAO automatically establishes when your application first references any DAO object.
This Workspace is referenced by DBEngine.Workspaces(0) or simply Workspaces(0).
53. Microsoft Jet Database / ODBC Direct
Microsoft Jet Database
A database management system that retrieves data from and stores data in user and system databases.
The Microsoft Jet database engine can be thought of as a data manager component with which other data access systems,
such as Microsoft Access and Visual Basic, are built.
ODBC Direct
A technology that allows you to access ODBC data sources directly by using DAO features that
bypass the Microsoft Jet database engine.
54. ODBC
ODBC (Open Database Connectivity)
A standard protocol that permits applications to connect to a variety of external database servers or files.
ODBC drivers used by the Microsoft Jet database engine permit access to Microsoft SQL Server
and several other external databases.
Syntax with a DSN or FileDSN:
"[Provider=MSDASQL;] { DSN=name FileDSN=filename } ; [DATABASE=database;] UID=user; PWD=password"
Syntax without a DSN (DSN-less connection):
"[Provider=MSDASQL;] DRIVER=driver; SERVER=server; DATABASE=database; UID=user; PWD=password"
55. Uses of ActiveX Documents
If you want to have control over the whole frame of the browser window, rather than just a part of it.
When you display a Web page in the browser, the HTML you write to display the page lets you specify the
appearance of only the page itself. You cannot write HTML to control the menu, the scroll bar, or any other part
of the browser window. When you use an ActiveX document, you can control additional pieces of the window:
You can add menus, toolbars, scroll bars, and other items. For example, if you want one page of your
DHTML application to contain a custom menu, you might use an ActiveX document.
56. Line styles in Treeview control
tvwTreeLines 0 (Default) Tree lines. Displays lines between Node siblings and their parent Node.
tvwRootLines 1 Root Lines. In addition to displaying lines between Node siblings and their parent Node,
also displays lines between
the root nodes.
57. Under ADO command object which collection is responsible for input.
Parameter collection is responsible for input
A Properties collection contains all the Property objects for a specific instance of an object.
58. Lock Edit Property in DAO and RDO
True
Pessimistic locking is in effect. The 2K page containing the record you're editing is locked as soon as you call the Edit method
False
Optimistic locking is in effect for editing. The 2K page containing the record is not locked until the Update method is executed.
59. Cursor Types in DAO and ADO
Cursor type
Recordset type
Comments
Forward-only
Forward-only
If you only need to view each row one time, the forward-only cursor is fast and very efficient in its use of system resources.
Static
Snapshot
If your application does not need to see changes, a static cursor with a snapshot recordset may work.
Keyset
Dynaset
If your application needs to see changed rows, and there is no concern about added or deleted rows, the keyset cursor with a dynaset recordset is a good choice.
Dynamic
Dynamic
If your application needs to see all changed rows, row order, and row values, the dynamic cursor with a dynamic recordset is a good choice.
60. Number of events in Timer Control
only one - Timer Event
No comments:
Post a Comment