Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger


Showing posts with label VB. Show all posts
Showing posts with label VB. Show all posts

Thursday, 19 June 2008

Visual Basic IMPORTANT QUESTIONS

  1. How do you register a component? Expected answer: Compiling the component, running REGSVR32 MyDLL.dll
  2. Name and explain the different compatibility types when creating a COM component. Expected answer: No Compatibility ? New GUID created, references from other components will not workProject Compatibility ? Default for a new component Binary Compatibility ? GUID does not change, references from other components will work
  3. Why iss it important to use source control software for source code? Expected answer: Modification history.Code ownership: Multiple people can not modify the same code at the same time.
  4. What two methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful? Expected answer: SetComplete and SetAbort.
  5. What is the tool used to configure the port range and protocols for DCOM communications? Expected answer: DCOMCONFIG.EXE
  6. What does Option Explicit refer to? Expected answer: All variables must be declared before use. Their type is not required.
  7. What are the different ways to Declare and Instantiate an object in Visual Basic 6? Expected answer: Dim obj as OBJ.CLASS with eitherSet obj = New OBJ.CLASS orSet obj = CreateObject(?OBJ.CLASS?) orSet obj = GetObject( ,? OBJ.CLASS?)orDim obj as New OBJ.CLASS
  8. Name the four different cursor types in ADO and describe them briefly. Expected answer: The cursor types are listed from least to most resource intensive.Forward Only ? Fastest, can only move forward in recordset Static ? Can move to any record in the recordset. Data is static and never changes.KeySet ? Changes are detectable, records that are deleted by other users are unavailable, and records created by other users are not detectedDynamic ? All changes are visible.
  9. Name the four different locking type in ADO and describe them briefly. Expected answer: LockPessimistic ? Locks the row once after any edits occur.LockOptimistic ? Locks the row only when Update is called.LockBatchOptimistic ? Allows Batch Updates.LockReadOnly ? Read only. Can not alter the data.
  10. Describe Database Connection pooling (relative to MTS ) Expected answer: This allows MTS to reuse database connections. Database connections are put to ?sleep? as opposed to being created and destroyed and are activated upon request.
  11. What are the ADO objects? Explain them. Provide a scenario using three of them to return data from a database. Expected answer: Connection ? Connects to a data source; contains the Errors collectionCommand ? Executes commands to the data source. Is the only object that can accept parameters for a stored procedure.Recordset ? The set of data returned from the database.Scenario: There are many possibilities. The most likely is as follows:Dim conn As ADODB.ConnectionDim rs As ADODB.RecordsetDim Cmd As ADODB.Commandconn.ConnectionString = ?CONNECTION STRING?conn.OpenSet Cmd.ActiveConnection = connCmd.CommandText = ?SQL STATEMENT?Set rs = Cmd.ExecuteSet rs.ActiveConnection = Nothingconn.Close
  12. Under the ADO Command Object, what collection is responsible for input to stored procedures? Expected answer: The Parameters collection.
  13. What are some benefits of using MTS? Expected answer: Database Pooling, Transactional operations, Deployment, Security, Remote Execution.
  14. What is the benefit of wrapping database calls into MTS transactions? Expected answer: If database calls are made within the context of a transaction, aborting the transaction will undo and changes that occur within that transaction. This removes the possibility of stranded, or partial data.
  15. Describe and In Process vs. Out of Process component. Which is faster? Expected answer:An in-process component is implemented as a DLL, and runs in the same process space as its client app, enabling the most efficient communication between client and component.Each client app that uses the component starts a new instance of it.An out of process component is implemented as an EXE, and unlike a dll, runs in its own process space. As a result, exe’s are slower then dll’s because communications between client and component must be marshalled across process boundaries. A single instance of an out of process component can service many clients.
  16. What are the main components of the ADO object model? How are they used? Expected answer:Connection: Used to make a connection between your app and an external data source, ie, sql server.Command: Used to build queries, including user-specific parameters, to access records from a data source (which are returned in a Recordset)Recordset:Used to access records returned from an SQL query. With a recordset, you can navigate returned records. You can also add, modify or delete records.

Basic VB interview questions

  1. How do you center a form?
  2. Can I send keystrokes to a DOS application?
  3. Convert an RGB value to a long, or a long to RGB.
  4. Implement smooth scrolling for either text, graphics or controls across a form.
  5. Implement some quick and easy encryption (can be something primitive).
  6. 4 different types of sorts: advantages and disadvantages.
  7. Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC.
  8. How do you use the Mouse OFF event?
  9. How do I call Windows Help files from a VB program?
  10. How do I create a textbox that lets you insert tabs?
  11. How do I make text box that displays asterisks when the user types in data such as password?
  12. How do I create multi-column combo box?
  13. How do I make a menu popup from a CommandButton?
  14. How to create menus at run time in VB?
  15. Write a generic error handling routine.
  16. How to copy text to the Windows clipboard and from it.
  17. How can I call a Command button without clicking it?
  18. Write a simple app with Encrypt and Decrypt buttons and Textbox where the user can enter text for encryption and decryption.

Open-ended .NET questions

  1. What is the difference between VB 6 and VB.NET?
  2. What are the authentication methods in .NET?
  3. What’s the use of formatters in .NET?
  4. What is Serialization in .NET?
  5. How is Threading done in .NET?
  6. Differences between Namespace, Class, Assembly?
  7. What’s the use of System.Diagnostics.Process class?

Visual Basic interview questions

  1. How do you center a form?
  2. Can I send keystrokes to a DOS application?
  3. Convert an RGB value to a long, or a long to RGB.
  4. Implement smooth scrolling for either text, graphics or controls across a form.
  5. Implement some quick and easy encryption (can be something primitive).
  6. 4 different types of sorts: advantages and disadvantages.
  7. Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC.
  8. How do you use the Mouse OFF event?
  9. How do I call Windows Help files from a VB program?
  10. How do I create a textbox that lets you insert tabs?
  11. How do I make text box that displays asterisks when the user types in data such as password?
  12. How do I create multi-column combo box?
  13. How do I make a menu popup from a CommandButton?
  14. How to create menus at run time in VB?
  15. Write a generic error handling routine.
  16. How to copy text to the Windows clipboard and from it.
  17. How can I call a Command button without clicking it?
  18. Write a simple app with Encrypt and Decrypt buttons and Textbox where the user can enter text for encryption and decryption.
  19. 3 main differences between flexgrid control and dbgrid control
  20. ActiveX and Types of ActiveX Components in VB
  21. Advantage of ActiveX Dll over ActiveX Exe .
  22. Advantages of disconnected recordsets . Benefit of wrapping database calls into MTS transactions 6. Benefits of using 23 MTS
  23. Can database schema be changed with DAO, RDO or ADO?
  24. Can you create a tabletype of recordset in Jet-connected ODBC database engine?
  25. Constructors and destructors
  26. Controls which do not have events
  27. Default property of datacontrol
  28. Define the scope of Public, Private, Friend procedures?
  29. Describe Database Connection pooling relative to MTS
  30. Describe: In of Process vs. Out of Process component. Which is faster?
  31. Difference between a function and a subroutine, Dynaset and Snapshot, early and late binding, image and picture controls, linked object and embedded Object,listbox and combo box,Listindex and Tab index,modal and moduless window, Object and Class, query unload and unload in form, declaration and instantiation of an object?
  32. Draw and explain Sequence Model of DAO
  33. How can objects on different threads communicate with one another?
  34. How can you force new objects to be created on new threads?
  35. How does a DCOM component know where to instantiate itself?
  36. How do I register a component?
  37. How do I set a shortcut key for label?
  38. What kind of components can be used as DCOM servers?
  39. Name of the control used to call a Windows application
  40. Name the four different cursor and locking types in ADO and describe them briefly
  41. Need of zorder method, no of controls in form, Property used to add a menus at runtime, Property used to count number of items in a combobox,resize a label control according to your caption.
  42. Return value of callback function, The need of tabindex property
  43. Thread pool and management of threads within a thread pool
  44. To set the command button for ESC, Which property needs to be changed?
  45. Type Library and what is it’s purpose?
  46. Types of system controls, container objects, combo box
  47. Under the ADO Command Object, what collection is responsible for input to stored procedures?
  48. What are the ADO objects? Explain them.
  49. What are the different compatibility types when we create a COM component?
  50. What do ByVal and ByRef mean and which is the default?
  51. What does Option Explicit refer to? 36. What does the Implements statement do?
  52. What is OLE and DDE? Explain.
  53. What is the difference between Msgbox Statement and MsgboxQ function?
  54. What keyword is associated with raising system level events in VB?
  55. What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
  56. What types of data access have you used.
  57. What was introduced to Visual Basic to allow the use of Callback Functions?
  58. Which controls can not be placed in MDI?
  59. Which controls have refresh method, clear method
  60. Which Property is used to compress a image in image control?
  61. Which property of menu cannot be set at run time?
  62. Which property of textbox cannot be changed at runtime?
  63. What is the maximum size of a textbox?
  64. Which tool is used to configure the port range and protocols for DCOM communications?

Some VB interview questions

  1. How do you represent your menu description in the status Bbr of your MDI? So that when I move the mouse over menu option, the description is shown in appropriate status bar?
  2. How would you make a program which scans a bar code and perform action depending on the bar code value?
  3. What is the difference between Windows programming and database programming?
  4. How do you combine a number of ActiveX control, which you developed, into a single app?
  5. How do you interact with the hardware level within your VB code if no APIs or documentation is supplied?

Questions to ask VB programmer

  1. 3 main differences between flexgrid control and dbgrid control
  2. ActiveX and Types of ActiveX Components in VB
  3. Advantage of ActiveX Dll over Active Exe
  4. Advantages of disconnected recordsets
  5. Benefit of wrapping database calls into MTS transactions
  6. Benefits of using MTS
  7. Can database schema be changed with DAO, RDO or ADO?
  8. Can you create a tabletype of recordset in Jet - connected ODBC database engine?
  9. Constructors and distructors
  10. Controls which do not have events
  11. Default property of datacontrol
  12. Define the scope of Public, Private, Friend procedures?
  13. Describe Database Connection pooling relative to MTS
  14. Describe: In of Process vs. Out of Process component. Which is faster?
  15. Difference between a function and a subroutine, Dynaset and Snapshot,early and late binding, image and picture controls,Linked Object and Embedded Object,listbox and combo box,Listindex and Tabindex,modal and moduless window, Object and Class,Query unload and unload in form, Declaration and Instantiation an object?
  16. Draw and explain Sequence Modal of DAO
  17. How can objects on different threads communicate with one another?
  18. How can you force new objects to be created on new threads?
  19. How does a DCOM component know where to instantiate itself?
  20. How to register a component?
  21. How to set a shortcut key for label?
  22. Kind of components can be used as DCOM servers
  23. Name of the control used to call a windows application
  24. Name the four different cursor and locking types in ADO and describe them briefly
  25. Need of zorder method, no of controls in form, Property used to add a menus at runtime, Property used to count number of items in a combobox,resize a label control according to your caption.
  26. Return value of callback function, The need of tabindex property
  27. Thread pool and management of threads within a thread pool
  28. To set the command button for ESC, Which property needs to be changed?
  29. Type Library and what is it’s purpose?
  30. Types of system controls, container objects, combo box
  31. Under the ADO Command Object, what collection is responsible for input to stored procedures?
  32. VB and Object Oriented Programming
  33. What are the ADO objects? Explain them.
  34. What are the different compatibility types when we create a COM component?
  35. What do ByVal and ByRef mean and which is the default?
  36. What does Option Explicit refer to?
  37. What does the Implements statement do?
  38. What is OLE and DDE? Explain.
  39. What is the difference between Msgbox Statement and MsgboxQ function?
  40. What keyword is associated with raising system level events in VB?
  41. What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
  42. What types of data access have you used.
  43. What was introduced to Visual Basic to allow the use of Callback Functions?
  44. Which controls can not be placed in MDI?
  45. Which controls have refresh method, clear method
  46. Which Property is used to compress a image in image control?
  47. Which property of menu cannot be set at run time?
  48. Which property of textbox cannot be changed at runtime and What’s the maximum size of a textbox?
  49. Which tool is used to configure the port range and protocols for DCOM communications?

ASP interview questions

  1. What is wrong with Request.ServerVariables(”HTTP_REFERER”)?
  2. Why do I get 80020003 errors?
  3. How do I perform a Whois / DNS lookup from ASP?
  4. Why can’t I turn buffering off using Response.Buffer?
  5. Why do I get ‘HTTP/1.0 Invalid Application Name’ errors?
  6. Why can’t I use #EXEC in an ASP page?
  7. Why won’t QueryString values work with Server.Execute?
  8. How do I disable the back/forward buttons?
  9. Why do I get an ‘overflow’ error using CInt?
  10. Why can’t I browse localhost without a connection?
  11. How do I generate a treeview from ASP?
  12. Why do I get 80020009 errors?
  13. How do I get the computer name / IP address of the server?
  14. Why do I get 800A01F9 errors?
  15. Why do I get 80010105 errors?
  16. Why do I get 800A03EC errors?
  17. How do I send a MsgBox or InputBox from ASP?
  18. How do I pad digits with leading zeros?
  19. How do I make sure my servers have the same time?
  20. What is this ‘Cannot detect OS type’ error with NT 4.0 Option Pack?
  21. How do I fix the ::$DATA bug?
  22. How do I convert a name to proper case?
  23. Can I bypass the ten connection limitation in Workstation / Professional?
  24. Why do I get errors in the 800A0001 -> 800A000F range?
  25. Why do I get non-database-related 80004005 errors?
  26. Why do I get errors in the 800A0400 -> 800A041F range?
  27. Why do I get errors in the 800A0030 -> 800A003A range?
  28. Why do I get errors in the 800A03F1 -> 800A03FF range?
  29. How do I read the contents of a remote web page?
  30. Which editor should I use for developing ASP applications?
  31. Why won’t my ASP pages work in IIS 6.0?
  32. How do I prevent my ASP pages from caching?

VB interview questions

  1. What is the method for returning more than one values from a function in VB?
  2. What is early-binding and late-binding? Does ASP support early-binding?
  3. Difference between T-SQL and PL/SQL?
  4. How can a COM object be modified in VB?
  5. What is Byval and ByRef in VB? And how does it work?
  6. Have you used inner join? How does it work? What is in the resultset? Rows from 1st table or 2nd table?
  7. What is disconnected mode?
  8. How is the error handling in stored proc of T-SQL?
  9. What is Transcaction?
  10. What is clustered index and non-clustered index? How many clustered indexes and non-clustered indexes can be created in one table?

VB interview questions

  1. You are creating a client application that calls ActiveX DLLs. Which of the following properties of the Err object provides the name of a component that sends an error back to the client application?
    • Number
    • Description
    • CompName
    • Component
    • Source
    • Text
    • Desc
    • None of the above
  2. If the Cancel Error Property of the CommonDialog Box is set to true then which of the following statement is true:
    • A runtime error can result if the user clicks the cancel button
    • A compile time error occurs
    • The program executes without any error
    • You need to carry out conditional compilation
    • None of the above

  3. What is the extension of the Visual Basic project file that stores the design of a user control.
    • .ctx
    • .ctl
    • .ctr
    • .ocx
    • .vbp
    • .dll
    • .ucl
    • .utl
  4. A __________ control defaults to displaying the files in the current directory:
    • File List Box
    • Dir List Box
    • Drive List Box
    • Combo Box
    • Picture Box
    • List Box
    • Combo Box
    • DataGrid
  5. To destroy an object and free the memory space occupied by it, the keyword used is:
    • Delete
    • Kill
    • Nothing
    • New
    • Calloc
    • New
    • Conserve
    • Free
  6. Which event of a text box would you use for validating the data entered by the user?
    • Validate
    • Validation
    • Check
    • Audit
    • GotFocus
    • Checkdata
    • ValidateDate
  7. Which of the following statements forces inline error handling?
    • On Error GoTo linelabel
    • On Error GoTo Inline
    • On Error Stop
    • On Error Resume Next
    • On Error GoTo 0
    • On Error Resume
    • None of the above
  8. The _______ method resets the contents of bound controls to their original values when the user clicks on the cancel button.
    • UpdateControls
    • PaintPicture
    • Refresh
    • Resize
    • Resync
    • Restore
    • Cancel
    • Update
  9. To deactivate the Form UnLoad event, you make the following change in the function definiton:
    Private Sub Query_Unload(Cancel as Integer,UnloadMode as Integer)
    To prevent the Form from closing, you will set the:
    • Cancel parameter to a non-zero value
    • Cancel parameter to 0
    • UnloadMode parameter to a non-zero value
    • UnloadMode parameter to a zero value
    • UnloadMode parameter to 1
    • Cancel parameter to 1
  10. How many root nodes can a TreeView control have?
    • 1
    • 2
    • 3
    • 4
    • 5
    • 10
    • Up to 50
    • No limit
  11. A project group is a Project which:
    • Consists of several Programs
    • Consists of several Applications
    • Consists of Various Forms And Code Modules
    • Consists of several Projects
  12. Procedures declared in a _____ are local whereas procedures declared in a ______ are available to the whole application.
    • Form window, standard or code module
    • Project window, view code window
    • Class module, code module
  13. How can you keep the user from exiting a form by clicking the Close button?
    • Place code in the Terminate event
    • Place code in the Unload event
    • Place code in the QueryUnload event
    • This can only be done by using the Windows API
    • Place code in the Load event
    • Place code in the Terminate event
    • Place code in the Deactivate event
    • None of the above
  14. In order to provide a transparent background to the Form, you must change the _________ property to _______.
    • BackStyle, Opaque
    • BackColor, White
    • BackStyle, Transparent
    • BackColor, Parent Window’s Color
    • ZOrder, 0
    • BackColor, Transparent
  15. The _______ property enables Visual Basic to draw complete images in memory before displaying them on the Screen.
    • AutoRedraw = True
    • AutoRedraw = False
    • Refresh
    • PaintPicture
  16. You want to display the code and the description of an error. What would be the correct syntax?
    • Msgbox err.no & err.text
    • Msgbox err.number & err.text
    • Msgbox error.number & error.text
    • Msgbox error.number & error.description
    • Msgbox err.number & err.description
    • Msgbox err.num & err.description
    • Msgbox err.num & err.text
    • None of the above
  17. What is the purpose of the Image List Control?
    • To display images to the user
    • To help in creating a ToolBar
    • To allow the editing of icons
    • To provide a repository for images used by other controls
    • To provide images to the listbox control
    • To provide images for the splash screen
    • To provide icons for error messages
  18. Which method would you use to get a free or unused File identifier while opening any file:
    • FreeFile
    • GetFileNum
    • GetFile
    • GetBytes
    • NextFile
    • File
    • GetNextFile
    • None of the above
  19. Which property procedure is used to retrieve the value of a property?
    • Retrieve
    • Get
    • GetProperty
    • Value
    • RetrieveValue
  20. Which of the following can be shown to the user using the Common Dialog control in VB?
    • Common messages passed to Windows
    • Open dialog box
    • Windows explorer
    • Input box
    • Message box
    • Error messages
    • Help
    • None of the above
  21. Which event is triggered when the user moves to another open form?
    • Unload
    • QueryUnload
    • Deactivate
    • Terminate
    • Load
    • Initialize
    • Repaint
    • Resize
  22. Which event of an ActiveX control data provider runs every time a bound control extracts data through the provider?
    • GetDataMember
    • GetDataField
    • GetDataProperty
    • GetDataRow
    • GetData
    • GetFields
    • GetRows
    • RetrieveData
  23. Which of the following are not properties of Command Button:
    • Caption
    • Visible
    • Multi-Line
    • Font
    • Name
    • Bold
    • Tag
    • Enabled
  24. You are creating an ActiveX component that raises user-defined errors. Which of the following statements correctly raises an error to the client with error number 20000?
    • Err.Raise vbObjectError + 20000
    • Err.Number = 20000
    • Err.Raise 20000
    • Err.Raise vbObjectError,20000
    • Err.Number 20000
    • Error.Raise vbObjectError + 20000
    • Error.Number 20000
    • Error.Raise 20000
  25. Which events enable you to determine which key was pressed by the user?
    • Click and KeyPress
    • Click, KeyUp and KeyDown
    • KeyUp and KeyDown
    • KeyPress, KeyUp and KeyDown
    • Click, KeyPress, KeyUp and KeyDown
  26. In order to access a file in Non-textual format, you have to open file in:
    • Ascii Format
    • Binary Format
    • Input Mode
    • Output mode
    • Append mode
    • Read Mode
  27. Visual Basic displays information depending upon the current value of two properties of the form, called:
    • CurrentX and CurrentY
    • ScaleLeft and ScaleTop
    • ScaleHeight and ScaleTop
    • x and y
    • TopX and TopY
    • LeftX and LeftY
  28. Which of the following procedure types will execute when you assign a value to a property of an object?
    • Property Get
    • Property Assign
    • Property Let
    • Property Set
    • Public Sub
  29. In order to overlap the controls (say a command button) during design time, we use the ‘Send To Back’ or ‘Bring To Front’ option from the Edit menu. To change it dynamically (i.e.during program execution) we need to change:
    • Background color property
    • Caption property
    • ZOrder property
    • AutoRedraw property
    • SendtoBack property
    • BringtoFront property
    • Hide property
    • Show property
  30. Name the only property supported by a collection?
    • Name
    • Index
    • Count
    • Type
    • Value
    • Add
    • Remove
    • None of the above
  31. Which of the following situations would not cause the Initialize event of an ActiveX control to occur?
    • When a control is placed on a form at design time
    • When a form designer containing a control is closed
    • When a form is run
    • When a compiled application containing a control executes
    • When an application terminates and re-enters design-time for the host application
  32. Which event occurs only once in the entire life cycle of an ActiveX control?
    • Initialize
    • Resize
    • Terminate
    • WriteProperties
    • InitProperties
    • Activate
    • None of the above
  33. You are creating an ActiveX component that raises user-defined errors. What is the valid range of error numbers that you can use for user-defined errors?
    • 1-1000
    • 0-255
    • 1-65535
    • 0-1000
    • 513-65535
    • 1000-2000
    • 10000-20000
    • None of the above
  34. Which property of the ProgressBar determines how much of the bar is filled?
    • Min
    • Max
    • Value
    • CurrentVal
    • FillValue
    • Fill
    • BarComplete
  35. The ______ function can be used to run any .com, .exe, .bat or .pif file from a Visual Basic program.
    • Shell
    • Substr
    • SetAttr
    • CStr
    • Exec
    • Perform
    • Do
    • None of the above
  36. One can convert a Visual Basic Application into ActiveX Document using:
    • Visual Database Manager
    • Application Wizard
    • ActiveX Document Migration Wizard
    • Package and Deployment Wizard
  37. The caption and the name properties of the command button:
    • Are one and the same
    • Can be different at times
    • Are actually not properties
  38. You try to initialize a new Object variable with the following line but receive an error. What could be the possible cause?
    Set MyVar = New Classname
    • You do not need to use the Set command here
    • You do not have the permission to access the class
    • MyVar has not been declared
    • You do not need to use the New keyword here
    • None of the above
  39. Which of the following will perform a direct execution of a Command object?
    • The Execute method
    • The Prepare method
    • The ExecDirect method
    • The Open method
    • The Exec method
    • The ExecProcedure method
    • None of the above
  40. The vbCritical symbol displays:
    • A warning query icon
    • A critical message icon
    • A warning message icon
    • An exclamation icon
    • None of the above
  41. What does the forms collection contain?
    • A list of all forms in a project
    • A list of all hidden forms
    • A list of all currently loaded forms
    • A list of all visible forms
    • All the child forms of an MDI application
  42. Which method of the Recordset object should you use to navigate multiple recordsets returned by a stored procedure?
    • NewRecordset
    • NavigateRecordset
    • OpenNextRecordset
    • NextRecordset
    • SkipRecordset
    • PreviousRecordset
    • JumpRecordset
    • GoTORecordset
  43. Which of the following cannot be included in the Open method of the recordset?
    • Cursor Type
    • User Name
    • Active Connection
    • CursorLocation
    • LockType
    • Source
  44. The settings for the Color properties in Visual Basic are indicated by:
    • Decimal Coding
    • Octal Coding
    • Hexadecimal Coding
    • Binary Coding
  45. What you must do before you make calls to an ActiveX DLL project in the same Project Group?
    • Compile the DLL
    • Check the DLL off in your project’s Reference List
    • Make sure the DLL is the Startup Project
    • Ensure that a Standard Exe form is included and is made the Startup Form.
  46. The _______ property changes the tab order at runtime:
    • Tab stop
    • Tab key
    • Tab order
    • Tab index
  47. What do CurrentX and CurrentY return?
    • Current X and Y co-ordinates of mousepointer
    • Current X and Y co-ordinates of cursor
    • A String of X & Y
    • Current x and y co-ordinates of the control
  48. The Kill command in Visual Basic is used for:
    • Stopping the current process
    • Deleting files
    • Terminating the application
    • Stopping the current thread
    • Debugging the application
    • Error handling
    • None of the above
  49. If one needs to use an ampersand(&) in a Label but does not want it to be an Access Key, the _______ property of the label must be set to False.
    • Caption
    • ClipControls
    • UseMnemonic
    • LinkMode
    • Locked
    • Label
    • ZOrder
    • Visible
  50. Which of the following is the only drag related event?
    • DragEnter
    • DragLeave
    • DragStart
    • DragStop
    • DragDrop
    • BeginDrag
    • EndDrag
  51. Which property of the form changes the form’s title?
    • Name
    • Heading
    • Title
    • Caption
    • Logo
  52. Labels do not respond to _____ and ______ events.
    • Got_Focus, Lost_Focus
    • Click, DblClick
    • Dragdrop, OLECompleteDrag
    • Change, Link Error
  53. Which of the following statements is capable of abandoning a series of modifications made to a recordset locked with a BatchOptimistic lock?
    • CancelUpdate
    • CancelBatch
    • CancelBatchUpdate
    • AbandonBatch
    • AbandonBatchUpdate
    • Rollbackupdate
    • Rollbackbatch
    • None of the above
  54. Which three methods does the collection object support?
    • Let, Get, Set
    • Load, Unload, Count
    • Add, Remove, Item
    • Add, Delete, Index
    • Add, Remove, Sort
    • Add, Remove, Count
    • Add, Delete, Count
    • Add, Set, Count
  55. Which line of code listed here can be used to create a string of fixed length:
    • Dim strFirstName as String
    • strFirstName * 255
    • strFirstName = 255
    • Dim strFirstName as String(255)
    • None of the above
  56. Consider the following program code:

    (i) Dim FileName as String
    Open FileName For Input As #FreeFile


    (ii) Dim FileName as String
    FileNum = FreeFile
    Open FileName For Input As #FileNum
    • Both (i) and (ii) are correct
    • Only (i) is correct
    • Only (ii) is correct
    • (i) contains a logical error
    • (ii) contains an error
    • Both (i) and (ii) contain errors
  57. Which property of the Err object returns the numeric value associated with the most recent runtime error?
    • Description
    • No
    • Number
    • Source
    • Errorcode
    • Num
    • Code

    59 ) In Visual Basic, which method can you use to send key strokes to other Window applications?

    • AppActivate
    • SendKeys
    • Copying the contents from the ClipBoard & pasting
    • Manually typing in the other application’s Window
  58. The ______ property is used to show Tool Tips or Help Balloons when the mouse rests on the object:
    • ToolTipText
    • Tag
    • Dragmode
    • ShowTips
    • Help
    • Tip
    • ShowHelp
    • Tab
  59. What is the sequence in which the following events are triggered when a form is loaded?
    • Initialize, Load, Resize and Paint
    • Initialize, Load, Paint and Resize
    • Load, Initialize, Resize and Paint
    • Load, Initialize, Paint and Resize
    • Initialize, Resize, Paint and Load
    • Load, Paint, Initialize and Resize
    • Initialize, Paint, Load and Resize
    • Paint, Resize, Initialize and Load
  60. Which parameter of the WriteProperty method can be omitted but should be included to increase the efficiency of the control?
    • Name
    • Value
    • Caption
    • PropBag
    • DefaultValue
    • Title
    • Tag
    • None of the above
  61. Message Boxes can hold a maximum of _______ characters.
    • 256
    • 512
    • 1024
    • 2046
    • 4092
    • 5000
    • 10000
    • No limit
  62. Which parameter of the Execute method of the Connection object returns the number of records that the operation affected?
    • RecordsAffected
    • RowsAffected
    • RecordsUpdated
    • RowsOperated
    • RecordsOperated
  63. Which of the following is not an element of the ADO model?
    • Database
    • Error
    • Connection
    • Parameter
    • Recordset
    • Field
    • Driver
  64. What data type is the HelpContextID?
    • String
    • Integer
    • Single
    • Double
    • Long
    • Char
    • Float
  65. Variables that allow sharing of values across event procedures are called:
    • Form level variable
    • Object variable
    • Module level variable
  66. Which property of the ListView control determines which field a sort is based on?
    • Sorted
    • SortKey
    • SortOrder
    • SortField
    • Sort
    • Key
    • ListKey
    • None of the above
  67. Consider the following subprogram:

    Sub ChangeText(ByVal X as String,Y as String)
    Y = X
    End Sub
    If you are calling it using the following code:
    Call ChangeText(Form1.Caption,Y$)
    • The Caption of Form1 will change to the value contained in Y$
    • The Caption of Form1 will not change
    • The Caption changes at random intervals after the function call
    • The code is incorrect
  68. Visual Basic fires the _______ event everytime a part of the form is newly exposed.
    • Load
    • Activate
    • Paint
    • Show
    • Initialize
  69. Which of the following ADO recordset types provides the greatest degree of concurrency?
    • Static
    • Forward-only
    • Dynamic
    • Keyset
    • Read only
    • Keyset and Dynamic
  70. Which of the following is the only valid Resume statement in an error handler?
    • Resume prior
    • Resume previous
    • Resume later
    • Resume next
    • Resume before
    • Resume to
    • Resume statement
    • Resume applicationv

MS SQL Server developer interview

  1. Which of the following has the highest order of precedence?
    • Functions and Parenthesis
    • Multiplication, Division and Exponents
    • Addition and Subtraction
    • Logical Operations
  2. When designing a database table, how do you avoid missing column values for non-primary key columns?
    • Use UNIQUE constraints
    • Use PRIMARY KEY constraints
    • Use DEFAULT and NOT NULL constraints
    • Use FOREIGN KEY constraints
    • Use SET constraints

  3. Which of the following is the syntax for creating an Index?
    • CREATE [UNIQUE] INDEX index_name OF tbl_name (index_columns)
    • CREATE [UNIQUE] INDEX OF tbl_name (index_columns)
    • CREATE [UNIQUE] INDEX ON tbl_name (index_columns)
    • CREATE [UNIQUE] INDEX index_name ON tbl_name (index_columns)
  4. Which of the following is not a valid character datatype in SQL Server?
    • BLOB
    • CHAR
    • VARCHAR
    • TEXT
    • VARTEXT
  5. Which of the following statements about SQL Server comments is false?
    • /* … */ are used for multiline comments
    • // is used for single line comments
    • – is used for single line comments
    • Nested comments are allowed i.e. /* comment 1 /* comment 2 */ comment 1*/
    • ‘ is used for single line comments
  6. Consider the following transaction code:

    Begin Transaction
    Update names_table set employee_name = "Ramesh" where employee_name = "Mahesh"
    Save Transaction SAVE_POINT
    Update salaries set salary=salary + 900 where employee_job = "Engineer"
    Rollback transaction
    Commit transaction

    What will be the result produced by this transaction?
    • “Ramesh” will be updated to “Mahesh”, but salaries of engineers will not be
    • updated

    • Neither “Ramesh” will be updated to “Mahesh”, nor the salary of engineers will be updated.
    • “Ramesh” will be updated to “Mahesh” and salary of engineers will also be
    • updated.

  7. Which of the following constraints can be used to enforce the uniqueness of rows in a table?
    • DEFAULT and NOT NULL constraints
    • FOREIGN KEY constraints
    • PRIMARY KEY and UNIQUE constraints
    • IDENTITY columns
    • CHECK constraints
  8. Which of the following are not date parts?
    • quarter
    • dayofweek
    • dayofyear
    • weekday
  9. The IF UPDATE (column_name) parameter in a trigger definition will return
    TRUE in case of an INSERT statement being executed on the triggered table:
    • Yes
    • No
    • It returns TRUE only if an UPDATE query is executed
    • Both b and c
  10. Which one of the following must be specified in every DELETE statement?
    • Table Name
    • Database name
    • LIMIT clause
    • WHERE clause
    • Column Names
  11. Which one of the following correctly selects rows from the table myTable that have null in column column1?
    • SELECT * FROM myTable WHERE column1 is null
    • SELECT * FROM myTable WHERE column1 = null
    • SELECT * FROM myTable WHERE column1 EQUALS null
    • SELECT * FROM myTable WHERE column1 NOT null
    • SELECT * FROM myTable WHERE column1 CONTAINS null
  12. Is this statement true or false:
    A cursor is a pointer that identifies a specific working row within a set
    • True
    • False
  13. Which of the following commands is used to change the structure of table?
    • CHANGE TABLE
    • MODIFY TABLE
    • ALTER TABLE
    • UPDATE TABLE
  14. Consider the following statements and pick the correct answer:

    1. ceiling() - returns the smallest integer greater than or equal to the specified value
    2. floor() - returns the largest integer less than or equal to the specified value
    • 1 is true and 2 is false
    • 1 is false and 2 is true
    • Both 1 and 2 are true
    • Both 1 and 2 are false
  15. What is the correct SQL syntax for returning all the columns from a table named “Persons” sorted REVERSE alphabetically by “FirstName”?
    • SELECT * FROM Persons WHERE FirstName ORDER BY FirstName DESC
    • SELECT * FROM Persons SORT REVERSE ‘FirstName’
    • c . SELECT * FROM Persons ORDER BY ‘FirstName’

    • SELECT * FROM Persons ORDER BY FirstName DESC
    • SELECT * FROM Persons ORDER BY DESC FirstName

  16. What is the maximum value that can be stored for a datetime field?
    • Dec 31, 9999
    • Jun 6, 2079
    • Jan 1, 2753
    • Jan 1, 2100
  17. Consider the following queries:
    1. select * from employee where department LIKE "[^F-M]%”;
    2. select * from employee where department = “[^F-M]%”;

    Select the correct option:
    • Query 2 will return an error
    • Both the queries will return the same set of records
    • Query 2 is perfectly correct
    • Query 2 would return one record less than Query 1
  18. How can you view the structure of a table named “myTable” in SQL Server?
    • desc myTable
    • desc table myTable
    • sp_columns myTable
    • None of the above
    • Using either option a or c
  19. What does referential integrity (also called relational integrity) prevent?
    • Loss of data from employee sabotage
    • Loss of data from any one corrupted table
    • Recursive joins
    • One-to-many or many-to-many relationships between columns in a table
    • Data redundancy
  20. Which of the following is not a global variable?
    • @@colcount
    • @@error
    • @@rowcount
    • @@version
    • All are valid global variables
  21. Consider the following two tables:

    1. customers( customer_id, customer_name)
    2. branch ( branch_id, branch_name )
    What will be the output if the following query is executed:
    Select * branch_name from customers,branch
    • It will return the fields customer_id, customer_name, branch_name
    • It will return the fields customer_id, customer_name, branch_id, branch_name
    • It will return the fields customer_id, customer_name, branch_id, branch_name, branch_name
    • It will return an empty set since the two tables do not have any common field name
    • It will return an error since * is used alone for one table only
  22. Which of the following is not a control statement?
    • if…else
    • if exists
    • do…while
    • while
    • begin…end
  23. Which of the following is not a valid Numeric datatypes in SQL Server?
    • INT
    • SMALLINT
    • TINYINT
    • BIGINT
    • MONEY
  24. Which of the following datatypes is not supported by SQL-Server?
    • Character
    • Binary
    • Logical
    • Date
    • Numeric
    • All are supported
  25. What will the output be if you try to perform arithmetic on NULL values?
    • 0
    • NULL
    • It will generate an error message
    • Can’t be determined
  26. Which of the following options is not correct about the DATEDIFF() function?
    • It returns the difference between parts of two specified dates
    • It takes three arguments
    • It returns a signed integer value equal to second date part minus first date part
    • It returns a signed integer value equal to first date part minus second date part
  27. Sample Code

    CREATE TABLE table1(
    column1 varchar(50),
    column2 varchar(50),
    column3 varchar(50),
    column4 varchar(50));

    Which one of the following is the correct syntax for adding the column named “column2a” after column2 to the table shown above?
    • ALTER TABLE table1 ADD column2a varchar(50) AFTER column2;
    • MODIFY TABLE table1 ADD column2a AFTER column2;
    • INSERT INTO table1 column2a AS varchar(50) AFTER column2;
    • ALTER TABLE table1 INSERT column2a varchar(50) AFTER column2;
    • CHANGE TABLE table1 INSERT column2a BEFORE column3;
  28. State which of the following are true
    • Views are a logical way of looking at the logical data located in the tables
    • Views are a logical way of looking at the physical data located in the tables
    • Tables are physical constructs used for storage and manipulation of data in databases
    • Tables are logical constructs used for storage and manipulation of data in databases
  29. Which of the following is not a valid binary datatype in SQL Server?
    • BINARY
    • VARBINARY
    • BIT
    • IMAGE
    • TESTAMP
  30. Which of the following is false with regards to sp_help?
    • When a procedure name is passed to sp_help, it shows the parameters
    • When a table name is passed to sp_help, it shows the structure of the table
    • When no parameter is passed, it provides a list of all objects and user-defined datatypes in a database
    • All of the above are true
    • Which of the following are false for batches (batch commands)?
      • Statements in a batch are parsed, compiled and executed as a group
      • None of the statements in the batch is executed if there are any syntax errors in the batch
      • None of the statements in the batch is executed if there are any parsing errors in the batch
      • None of the statements in the batch is executed if there are any fatal errors in the batch
    • Select the correct option:
      • Optimistic locking is a locking scheme handled by the server, whereas pessimistic locking is handled by the application developer
      • Pessimistic locking is a locking scheme handled by the server, whereas optimistic locking is handled by the application developer

EDS Visual Basic and SQL Server interview questions

1. What is the difference between modal and modaless form in VB?
2. Why we need a MDI form? How can we make a form as a mdichild form?
3. Specify technical & functional architecture of your last 2 projects.
4. What are the objects in ADODB?
5. What are different types of cursors in ADODB?
6. What are different types of locks in ADODB?
7. What is disconnected recordset?

8. Besides Standard Exe what are other types of projects in VB?
9. What is the difference among Standard EXE, Active-X DLL, Active-X EXE?
10. A standard exe contains a registered Active-X DLL. Now some error arise in the application but not in the standard exe , it is in the Active-X DLL. How do you find it out in which line no the error is?
11. How can we find out that a recordset is blank (without using recordcount property)?
12. What is the difference between procedure and functions in VB?
13. What are the differences between stored procedure and functions in SQL Server 2000?
14. I want to develop a stand alone application which can communicate with the existing applications in the system. On which this application should be based on: Standard Exe,Active-X Exe,Active-X Dll.
15. can we call stored Procedure in Function in Sql Server 2000 and vice versa.
16. What is an extended Stored Procedure?
17. What is Trigger?
18. Suppose I made an after Trigger on Delete. Now I fire Delete * From tablename. will this trigger work? Now do I fire truncate from table name (instead of delete command). will this trigger work now? If yes or no then why?
19. What is a view? is View updatable?
20. What is the difference between having and where clause?
21. Why we need a group by clause?
22. What is a join and their types?
23. What is the difference between referencing and joining?
24. What is the difference between constraints and triggers?
25. What is the maximum size of form to hold the controls?
26. Write the correct order of execution of following form’s events: initialization, Load, Activate, Refresh , Paint
27. What is ACID Property of Transaction?
28. How do we call MS- Excel in VB?
29. What does option Explicit means?
30. What is an index?
31. What is normalization and its forms?
32. What does Query_unload event do in VB? Why we need Form _unload event?
33. What is a cursor in SQL Server 2000 and their types?
34. How do we get month name in SQL Server 2000, Oracle, MS Access?
35. How do we return a record set from a Stored Procedure in SQl server 2000?
36. What are the magic tables in SQL Server 2000?
37. What is Enum in VB?

There are 2 tables:
EMP : EmpId, Ename, Sal, DeptId
DEPT : DeptId, Dname

38. Write a query to find out emp names and their department names. if any emp has null in Deptid the it shows “No Department”.
39. Write a query to find out those department names which has no employee.
40. Write a query to find out those employees whose salary is greater than their department’s average salary.
41. How do we get current date in SQL Server 2000, Oracle, MS Access?