- How do you register a component? Expected answer: Compiling the component, running REGSVR32 MyDLL.dll
- 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 - 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.
- What two methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful? Expected answer: SetComplete and SetAbort.
- What is the tool used to configure the port range and protocols for DCOM communications? Expected answer: DCOMCONFIG.EXE
- What does Option Explicit refer to? Expected answer: All variables must be declared before use. Their type is not required.
- 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
- 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.
- 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.
- 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.
- 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
- Under the ADO Command Object, what collection is responsible for input to stored procedures? Expected answer: The Parameters collection.
- What are some benefits of using MTS? Expected answer: Database Pooling, Transactional operations, Deployment, Security, Remote Execution.
- 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.
- 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.
- 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.
Showing posts with label VB. Show all posts
Showing posts with label VB. Show all posts
Thursday, 19 June 2008
Visual Basic IMPORTANT QUESTIONS
Basic VB interview questions
- How do you center a form?
- Can I send keystrokes to a DOS application?
- Convert an RGB value to a long, or a long to RGB.
- Implement smooth scrolling for either text, graphics or controls across a form.
- Implement some quick and easy encryption (can be something primitive).
- 4 different types of sorts: advantages and disadvantages.
- Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC.
- How do you use the Mouse OFF event?
- How do I call Windows Help files from a VB program?
- How do I create a textbox that lets you insert tabs?
- How do I make text box that displays asterisks when the user types in data such as password?
- How do I create multi-column combo box?
- How do I make a menu popup from a CommandButton?
- How to create menus at run time in VB?
- Write a generic error handling routine.
- How to copy text to the Windows clipboard and from it.
- How can I call a Command button without clicking it?
- 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
- What is the difference between VB 6 and VB.NET?
- What are the authentication methods in .NET?
- What’s the use of formatters in .NET?
- What is Serialization in .NET?
- How is Threading done in .NET?
- Differences between Namespace, Class, Assembly?
- What’s the use of System.Diagnostics.Process class?
Visual Basic interview questions
- How do you center a form?
- Can I send keystrokes to a DOS application?
- Convert an RGB value to a long, or a long to RGB.
- Implement smooth scrolling for either text, graphics or controls across a form.
- Implement some quick and easy encryption (can be something primitive).
- 4 different types of sorts: advantages and disadvantages.
- Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC.
- How do you use the Mouse OFF event?
- How do I call Windows Help files from a VB program?
- How do I create a textbox that lets you insert tabs?
- How do I make text box that displays asterisks when the user types in data such as password?
- How do I create multi-column combo box?
- How do I make a menu popup from a CommandButton?
- How to create menus at run time in VB?
- Write a generic error handling routine.
- How to copy text to the Windows clipboard and from it.
- How can I call a Command button without clicking it?
- Write a simple app with Encrypt and Decrypt buttons and Textbox where the user can enter text for encryption and decryption.
- 3 main differences between flexgrid control and dbgrid control
- ActiveX and Types of ActiveX Components in VB
- Advantage of ActiveX Dll over ActiveX Exe .
- Advantages of disconnected recordsets . Benefit of wrapping database calls into MTS transactions 6. Benefits of using 23 MTS
- Can database schema be changed with DAO, RDO or ADO?
- Can you create a tabletype of recordset in Jet-connected ODBC database engine?
- Constructors and destructors
- Controls which do not have events
- Default property of datacontrol
- Define the scope of Public, Private, Friend procedures?
- Describe Database Connection pooling relative to MTS
- Describe: In of Process vs. Out of Process component. Which is faster?
- 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?
- Draw and explain Sequence Model of DAO
- How can objects on different threads communicate with one another?
- How can you force new objects to be created on new threads?
- How does a DCOM component know where to instantiate itself?
- How do I register a component?
- How do I set a shortcut key for label?
- What kind of components can be used as DCOM servers?
- Name of the control used to call a Windows application
- Name the four different cursor and locking types in ADO and describe them briefly
- 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.
- Return value of callback function, The need of tabindex property
- Thread pool and management of threads within a thread pool
- To set the command button for ESC, Which property needs to be changed?
- Type Library and what is it’s purpose?
- Types of system controls, container objects, combo box
- Under the ADO Command Object, what collection is responsible for input to stored procedures?
- What are the ADO objects? Explain them.
- What are the different compatibility types when we create a COM component?
- What do ByVal and ByRef mean and which is the default?
- What does Option Explicit refer to? 36. What does the Implements statement do?
- What is OLE and DDE? Explain.
- What is the difference between Msgbox Statement and MsgboxQ function?
- What keyword is associated with raising system level events in VB?
- What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
- What types of data access have you used.
- What was introduced to Visual Basic to allow the use of Callback Functions?
- Which controls can not be placed in MDI?
- Which controls have refresh method, clear method
- Which Property is used to compress a image in image control?
- Which property of menu cannot be set at run time?
- Which property of textbox cannot be changed at runtime?
- What is the maximum size of a textbox?
- Which tool is used to configure the port range and protocols for DCOM communications?
Some VB interview questions
- 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?
- How would you make a program which scans a bar code and perform action depending on the bar code value?
- What is the difference between Windows programming and database programming?
- How do you combine a number of ActiveX control, which you developed, into a single app?
- How do you interact with the hardware level within your VB code if no APIs or documentation is supplied?
Questions to ask VB programmer
- 3 main differences between flexgrid control and dbgrid control
- ActiveX and Types of ActiveX Components in VB
- Advantage of ActiveX Dll over Active Exe
- Advantages of disconnected recordsets
- Benefit of wrapping database calls into MTS transactions
- Benefits of using MTS
- Can database schema be changed with DAO, RDO or ADO?
- Can you create a tabletype of recordset in Jet - connected ODBC database engine?
- Constructors and distructors
- Controls which do not have events
- Default property of datacontrol
- Define the scope of Public, Private, Friend procedures?
- Describe Database Connection pooling relative to MTS
- Describe: In of Process vs. Out of Process component. Which is faster?
- 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?
- Draw and explain Sequence Modal of DAO
- How can objects on different threads communicate with one another?
- How can you force new objects to be created on new threads?
- How does a DCOM component know where to instantiate itself?
- How to register a component?
- How to set a shortcut key for label?
- Kind of components can be used as DCOM servers
- Name of the control used to call a windows application
- Name the four different cursor and locking types in ADO and describe them briefly
- 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.
- Return value of callback function, The need of tabindex property
- Thread pool and management of threads within a thread pool
- To set the command button for ESC, Which property needs to be changed?
- Type Library and what is it’s purpose?
- Types of system controls, container objects, combo box
- Under the ADO Command Object, what collection is responsible for input to stored procedures?
- VB and Object Oriented Programming
- What are the ADO objects? Explain them.
- What are the different compatibility types when we create a COM component?
- What do ByVal and ByRef mean and which is the default?
- What does Option Explicit refer to?
- What does the Implements statement do?
- What is OLE and DDE? Explain.
- What is the difference between Msgbox Statement and MsgboxQ function?
- What keyword is associated with raising system level events in VB?
- What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
- What types of data access have you used.
- What was introduced to Visual Basic to allow the use of Callback Functions?
- Which controls can not be placed in MDI?
- Which controls have refresh method, clear method
- Which Property is used to compress a image in image control?
- Which property of menu cannot be set at run time?
- Which property of textbox cannot be changed at runtime and What’s the maximum size of a textbox?
- Which tool is used to configure the port range and protocols for DCOM communications?
ASP interview questions
- What is wrong with Request.ServerVariables(”HTTP_REFERER”)?
- Why do I get 80020003 errors?
- How do I perform a Whois / DNS lookup from ASP?
- Why can’t I turn buffering off using Response.Buffer?
- Why do I get ‘HTTP/1.0 Invalid Application Name’ errors?
- Why can’t I use #EXEC in an ASP page?
- Why won’t QueryString values work with Server.Execute?
- How do I disable the back/forward buttons?
- Why do I get an ‘overflow’ error using CInt?
- Why can’t I browse localhost without a connection?
- How do I generate a treeview from ASP?
- Why do I get 80020009 errors?
- How do I get the computer name / IP address of the server?
- Why do I get 800A01F9 errors?
- Why do I get 80010105 errors?
- Why do I get 800A03EC errors?
- How do I send a MsgBox or InputBox from ASP?
- How do I pad digits with leading zeros?
- How do I make sure my servers have the same time?
- What is this ‘Cannot detect OS type’ error with NT 4.0 Option Pack?
- How do I fix the ::$DATA bug?
- How do I convert a name to proper case?
- Can I bypass the ten connection limitation in Workstation / Professional?
- Why do I get errors in the 800A0001 -> 800A000F range?
- Why do I get non-database-related 80004005 errors?
- Why do I get errors in the 800A0400 -> 800A041F range?
- Why do I get errors in the 800A0030 -> 800A003A range?
- Why do I get errors in the 800A03F1 -> 800A03FF range?
- How do I read the contents of a remote web page?
- Which editor should I use for developing ASP applications?
- Why won’t my ASP pages work in IIS 6.0?
- How do I prevent my ASP pages from caching?
VB interview questions
- What is the method for returning more than one values from a function in VB?
- What is early-binding and late-binding? Does ASP support early-binding?
- Difference between T-SQL and PL/SQL?
- How can a COM object be modified in VB?
- What is Byval and ByRef in VB? And how does it work?
- Have you used inner join? How does it work? What is in the resultset? Rows from 1st table or 2nd table?
- What is disconnected mode?
- How is the error handling in stored proc of T-SQL?
- What is Transcaction?
- 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
- 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
- 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
- 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
- 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
- To destroy an object and free the memory space occupied by it, the keyword used is:
- Delete
- Kill
- Nothing
- New
- Calloc
- New
- Conserve
- Free
- Which event of a text box would you use for validating the data entered by the user?
- Validate
- Validation
- Check
- Audit
- GotFocus
- Checkdata
- ValidateDate
- 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
- 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
- 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
- How many root nodes can a TreeView control have?
- 1
- 2
- 3
- 4
- 5
- 10
- Up to 50
- No limit
- 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
- 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
- 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
- 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
- The _______ property enables Visual Basic to draw complete images in memory before displaying them on the Screen.
- AutoRedraw = True
- AutoRedraw = False
- Refresh
- PaintPicture
- 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
- 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
- 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
- Which property procedure is used to retrieve the value of a property?
- Retrieve
- Get
- GetProperty
- Value
- RetrieveValue
- 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
- Which event is triggered when the user moves to another open form?
- Unload
- QueryUnload
- Deactivate
- Terminate
- Load
- Initialize
- Repaint
- Resize
- 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
- Which of the following are not properties of Command Button:
- Caption
- Visible
- Multi-Line
- Font
- Name
- Bold
- Tag
- Enabled
- 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
- 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
- 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
- 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
- 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
- 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
- Name the only property supported by a collection?
- Name
- Index
- Count
- Type
- Value
- Add
- Remove
- None of the above
- 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
- Which event occurs only once in the entire life cycle of an ActiveX control?
- Initialize
- Resize
- Terminate
- WriteProperties
- InitProperties
- Activate
- None of the above
- 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
- Which property of the ProgressBar determines how much of the bar is filled?
- Min
- Max
- Value
- CurrentVal
- FillValue
- Fill
- BarComplete
- 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
- One can convert a Visual Basic Application into ActiveX Document using:
- Visual Database Manager
- Application Wizard
- ActiveX Document Migration Wizard
- Package and Deployment Wizard
- The caption and the name properties of the command button:
- Are one and the same
- Can be different at times
- Are actually not properties
- 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
- 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
- The vbCritical symbol displays:
- A warning query icon
- A critical message icon
- A warning message icon
- An exclamation icon
- None of the above
- 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
- 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
- Which of the following cannot be included in the Open method of the recordset?
- Cursor Type
- User Name
- Active Connection
- CursorLocation
- LockType
- Source
- The settings for the Color properties in Visual Basic are indicated by:
- Decimal Coding
- Octal Coding
- Hexadecimal Coding
- Binary Coding
- 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.
- The _______ property changes the tab order at runtime:
- Tab stop
- Tab key
- Tab order
- Tab index
- 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
- 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
- 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
- Which of the following is the only drag related event?
- DragEnter
- DragLeave
- DragStart
- DragStop
- DragDrop
- BeginDrag
- EndDrag
- Which property of the form changes the form’s title?
- Name
- Heading
- Title
- Caption
- Logo
- Labels do not respond to _____ and ______ events.
- Got_Focus, Lost_Focus
- Click, DblClick
- Dragdrop, OLECompleteDrag
- Change, Link Error
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- Message Boxes can hold a maximum of _______ characters.
- 256
- 512
- 1024
- 2046
- 4092
- 5000
- 10000
- No limit
- Which parameter of the Execute method of the Connection object returns the number of records that the operation affected?
- RecordsAffected
- RowsAffected
- RecordsUpdated
- RowsOperated
- RecordsOperated
- Which of the following is not an element of the ADO model?
- Database
- Error
- Connection
- Parameter
- Recordset
- Field
- Driver
- What data type is the HelpContextID?
- String
- Integer
- Single
- Double
- Long
- Char
- Float
- Variables that allow sharing of values across event procedures are called:
- Form level variable
- Object variable
- Module level variable
- 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
- 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
- Visual Basic fires the _______ event everytime a part of the form is newly exposed.
- Load
- Activate
- Paint
- Show
- Initialize
- Which of the following ADO recordset types provides the greatest degree of concurrency?
- Static
- Forward-only
- Dynamic
- Keyset
- Read only
- Keyset and Dynamic
- 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
- Which of the following has the highest order of precedence?
- Functions and Parenthesis
- Multiplication, Division and Exponents
- Addition and Subtraction
- Logical Operations
- 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
- 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)
- Which of the following is not a valid character datatype in SQL Server?
- BLOB
- CHAR
- VARCHAR
- TEXT
- VARTEXT
- 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
- 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
- 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
updated.
- 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
- Which of the following are not date parts?
- quarter
- dayofweek
- dayofyear
- weekday
- 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
- Which one of the following must be specified in every DELETE statement?
- Table Name
- Database name
- LIMIT clause
- WHERE clause
- Column Names
- 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
- Is this statement true or false:
A cursor is a pointer that identifies a specific working row within a set- True
- False
- Which of the following commands is used to change the structure of table?
- CHANGE TABLE
- MODIFY TABLE
- ALTER TABLE
- UPDATE TABLE
- 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
- 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’
- SELECT * FROM Persons ORDER BY FirstName DESC
c . SELECT * FROM Persons ORDER BY ‘FirstName’
SELECT * FROM Persons ORDER BY DESC FirstName
- 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
- 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
- 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
- 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
- Which of the following is not a global variable?
- @@colcount
- @@error
- @@rowcount
- @@version
- All are valid global variables
- 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
- Which of the following is not a control statement?
- if…else
- if exists
- do…while
- while
- begin…end
- Which of the following is not a valid Numeric datatypes in SQL Server?
- INT
- SMALLINT
- TINYINT
- BIGINT
- MONEY
- Which of the following datatypes is not supported by SQL-Server?
- Character
- Binary
- Logical
- Date
- Numeric
- All are supported
- 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
- 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
- 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;
- 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
- Which of the following is not a valid binary datatype in SQL Server?
- BINARY
- VARBINARY
- BIT
- IMAGE
- TESTAMP
- 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?
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?
Subscribe to:
Posts (Atom)