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?

65.for Quest: 1
In the form properties, the startup position property is having two option regarding Center the form.

1. 1-Center Owner :- The form will be made centered based on the current form that calls the form. i.e., if already one form is opened then the next form will be the center to that form which will be called.

2. 2-Center Screen :- I hope no need of any explanation for this.

Tech Interviews comment by SSRST

66.for Quest 3 :

Converting an RGB Value to Long

LongVar = BlueValue * 65536 + GreenValue * 256 + redValue

Converting a Long to RGB

RedValue = LongValue Mod 256
GreenValue = ((LongValue And &HFF00) / 256&) Mod 256&
BlueValue = (LongValue And &HFF0000) / 65536

Source - from google.

Tech Interviews comment by SSRST

67.For Question No.11
To put an asterik mark for entered password characters in a textbox,there
is a textbox property namely Password Char.Put “*” there to get asterik sign for each entered password character.

Tech Interviews comment by Rajat Kapoor

68.Ans of Q.01 :- set StartupPosition=Center Screen of the form.

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

69.Ans of Q.12 : - VB doesn’t have multicolums prperty for a combobox,
but we can create a custome control using(textbox, command button and any grid).

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

70.Ans of Q.17 :- Just call the CommandButton1_Click event from anywhere.

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

71.Ans of Q. 20 :-
Types of ActiveX Components:- ActiveX Dll, ActiveX Exe, ActiveX Controls, ActiveX Document Dll, ActiveX Document Exe

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

72.Ans of Q.21 :-

Advantages of Dll over Exe:-
Dll is faster WRT exe, because dll runs within the same process space of its client
where as exe runs on its own process space.

Difference :-
1. Dll is faster than exe
2. dll is in-process whereas exe is out-process

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

73.Ans of Q.26 :-

Line, Shape, Label

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

74.Ans of Q.27 :-

Name is the default property.

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

75.Ans of Q.36 :-

run this command ” regsvr32 c:\…\MyDll.dll ” to register
run this command ” regsvr32 \u c:\…\MyDll.dll ” to un-register

Tech Interviews comment by Ranjit Kishor Verma (PRITHS)

76.Ans of Q51

Option Explicit is used to ensure that all variables
that are being used in the code are declared..

Tech Interviews comment by Sanjay Kumar

77.I disagree the answer of the Q.26 given by Mr.Ranjit Kishor Verma (PRITHS) that Label has no events. Lable has so many events like CLICK,DBLCLICK,MOUSEMOVE and amny more.
Only LINE and SHAPE control has No events.

Tech Interviews comment by Anjan

78.Ans of 60.
Use the Stretch property to determine whether the graphic is scaled to fit the control or vice versa.

Tech Interviews comment by Anjan

79.To set the command button for ESC, Which property needs to be changed?
cancel property needs to be set to true

Tech Interviews comment by vivek s

80.answer to Q.9 :

Option Explicit

Private Declare Function WinHelp Lib “user32″ Alias “WinHelpA” _
(ByVal hwnd As Long, ByVal lpHelpFile As String, _
ByVal wCommand As Long, ByVal dwData As Long) As Long

Private Const HELP_CONTENTS = 3
Private Const HELP_FINDER = 11

Private Sub Command1_Click()
Dim lResult As Long
Dim sHelpFile As String
Dim lCommand as Long, lOption as Long
sHelpFile = “winfile.hlp”
lOption = 0
lResult = WinHelp(Me.hwnd, sHelpFile, lCommand, lOption)
End Sub

source google

Tech Interviews comment by meenakshi

nice to see the questions u people posed and feeling some what happy in answering them please give us some more faq’s based on sql server 2000 and vb.net
very much interested in asp.net also
so i need some important and useful questions on asp.net also
thank you
with regards

Tech Interviews comment by abhinay ramadugu

82.Ans to Q14-

Menus at runtime in vb can be created using Windows API.

Tech Interviews comment by Dharmendra Joshi

83.Answer for question 1

Private Sub Form_Load()
Form1.Top = (Screen.Height - Form1.Height) / 2
Form1.Left = (Screen.Width - Form1.Width) / 2
End Sub

Tech Interviews comment by Subbu

84.For Question 58.
Controls without align property can not be placed directly on MDI form

Tech Interviews comment by Prashant Gadekar

85.How to call stored procedure from vb with code example.

Tech Interviews comment by Vishwanath

86.SSRST - YOU BEAUTY!!!! I have been looking for Long to RGB conversion for hours now! Big Thanks! It is for a colour picker tool I am putting together in my spare time. Excellent! You can check it out on my website( when I finish developing it). http://www.Ernz.co.uk

Tech Interviews comment by Ernz

87.4 different types of sorts: advantages and disadvantages

-quick sort
-bubble sort
-heap sort
-insertion sort

Quick sort is faster.

for further info: http://ciips.ee.uwa.edu.au/~morris/Year2/PLDS210/sorting.html

Tech Interviews comment by keeda

88.Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC.


Tech Interviews comment by keeda

89.How do you use the Mouse OFF event?

Call Win32 API CCTrackMouseEvent of Lib “COMCTL32.DLL”


Tech Interviews comment by keeda

90.How do I call Windows Help files from a VB program?


Tech Interviews comment by keeda

91.Quest No: 63

The Maximum length of the TextBox : 32,000 characters.

Please correct if wrong.

Tech Interviews comment by SSRST

92.Quest No: 62

Any of the designtime properties cannot be set at Runtime : Ex :- MultiLine Property.

Tech Interviews comment by SSRST

93.Quest No :- 58

The control without align property cannot be placed in an MDI Form. Eg:- TextBox. If we want to place even those control in MDI Form, then place a picture box in the MDI and form and place the controls in that.

Tech Interviews comment by SSRST

94.how can I send keystrokes to a dos application?

Tech Interviews comment by B.Bhaskar Rao

95.I am thinking the answers should look more like these
first 20 answers:

1. Center a form:

Private Sub Form_Load()
Me.Move (Screen.Width - Me.Width) \ 2, _
(Screen.Height - Me.Height) \ 2
End Sub

2. Keystrokes to DOS?

Yes, SendKeys sends keystrokes to the currently active window.

3. RGB to Long? Long to RGB?

Value = RGB(Red, Green, Blue)

Red = Value And &HFF
Green = (Value And &HFF00&) \ &H100&
Blue = (Value And &HFF0000) \ &H10000

4. Implement smooth scrolling?

Scrolling is simply movement in very small increments applied
fairly rapidly. The smallest noticeable increment value is
movement by one pixel. Text, graphics, or controls rapidly and
repeatedly moved in a single direction by one pixel each move
will appear to be moving smoothly.

5. Encrypt text.

Function Encrypt(Text As String, Password As String)
Dim idx As Long, key As Long
key = (Int(Sqr(Len(Password) * 95)) + 21)
Encrypt = Space$(Len(Text))
For idx = 1 To Len(Text)
Mid(Encrypt, idx, 1) = Chr$(Asc(Mid(Text, idx, 1)) Xor key)
End Function

6. Sort comparisons

NAME: Advantage (Disadvantage) - SL = Small Lists, LL = Large Lists

INSERTION: Simple, fast for SL (Slow for LL)
BUBBLE: Fast for lists almost sorted (Slow for all other lists)
QUICK: Fast for LL (Trouble with duplicates)
MERGE: Fast for LL, paging friendly (Requires scratch memory)

7. CRC32

See: http://www.freevbcode.com/ShowCode.Asp?ID=655

8. Mouse OFF?

There is no MouseOff event.

9. Call Help?

The Common Dialog control’s ShowHelp method is the
Microsoft recommended way of calling Help topics.

10. Allow tabs?

Set the textbox’s MultiLine property to True.

11. Display * ?

Set the textbox’s PasswardChar property to “*”.

12. Multi-column Combobox?

Creating your own control allows for many properties
and methods not found on the standard VB controls. One
method might include using the ListView as the drop down
list of a custom combobox.

13. Popup Menu?

Use the PopupMenu statement from the command button’s
MouseDown event.

14. Create runtime menus?

Design your menus as control arrays and use the Load
statement to add more menus.

15. Generic error handler?

Public Sub SomeRoutine()
On Error GoTo Handler
‘ trapped code added here
Exit Sub
MsgBox Err.Description, , “Error in processing”
Resume SubExit
End Sub

16. Clipboard text?

‘ To
Clipboard.SetText Text, vbCFText
‘ From
If Clipboard.GetFormat(vbCFText) Then
Text = Clipboard.GetText
End If

17. Call a command button click event?

Command1.Value = True

18. Write an app to Encrypt & Decrypt

One such application would be to include asyncronous
encryption which provides one routine for both
encryption and decryption. An example of asyncronous
encryption follows:

Public Function Crypt(Text As String) As String
Dim idx As Long, vlu As Long

Crypt = Text
For idx = 1 To Len(Text)
vlu = Asc(Mid$(Text, idx, 1))
Select Case vlu
Case 32 To 127
Mid(Crypt, idx, 1) = Chr$(128 - vlu)
Case Else
End Select

End Function

19. Flexgrid vs DBGrid?

1. User interface
2. Data source
3. Formatting methods

20. ActiveX ?

ActiveX is the technology used by Microsoft to
identify programmable components of an application.
The three main types of ActiveX components include
ActiveX EXE (Stand-alone, out-of-process), ActiveX
DLL (in-process), and the ActiveX Control (.ocx).

Tech Interviews comment by Larry Serflaten

96.The answer given for question no. Q.26 was revised to exclude Label from the list but further going, there is one more control which is being missed out which doesnt hold any events, its the common dialog control.

Tech Interviews comment by Uday Pharate

97.I believe 65500 words is the maximum length of text box

Tech Interviews comment by Taruna

98.The maximum length of text box is 65535. This is abosultly correct.

Tech Interviews comment by Saurabh Jain