1Sample
Code
Call MyProc(A,B)
MyProc A,B
What is the difference between the two lines of sample code above?
Choice 1
There is no difference. Neither one works.
Choice 2
There is no difference. Both work.
Choice 3
The difference is only Call MyProc(A,B) works.
Choice 4
The difference is only MyProc A,B works.
Choice 5
The difference between them depends on whether or not MyProc returns a value.
ANSWER--2
---------------------
2 You are distributing a remote ActiveX server which will use DCOM. When running
the setup wizard, which file type do you specifically have to add to your project to
configure DCOM?
Choice 1
VBR
Choice 2
REM
Choice 3
DEP
Choice 4
OCX
Choice 5
TLB
-----------------------
3 An ODBC keyset cursor is most similar to which type of DAO Recordset?
Choice 1
Snapshot
Choice 2
Dynaset
Choice 3
Table
Choice 4
Forward Only
Choice 5
There is no DAO Recordset type that approximates the ODBC keyset cursor.
ANSWER--2
--------------------
4 Sample Date
Tuesday, Jun 4 1968
What format string should be used with the Format$ function to produce a date in
the given format?
Choice 1
"d, mmm dd yyyy"
Choice 2
"dddd, mmmm ddd yyyy"
Choice 3
"d,mdyyyy"
Choice 4
"d, mmm d yyyy"
Choice 5
"dddd, mmmm d yyyy"
ANSWER--5
---------------------
5 Sample
Code
Sub Command1_Click()
Data1.RecordSource = "Select * From Authors"
You have placed a data control named DATA1 on your form. When Command1 is
clicked, what needs to be done to have the new RecordSource become active?
Choice 1
Add a DoEvents.
Choice 2
Data1.Requery
Choice 3
Data1.Execute
Choice 4
Data1.Refresh
Choice 5
Nothing - the code is complete.
-----------------
6 Sample
Code
If EXPR Then
MsgBox "Are you one Herbert?"
End If
What value, when substituted for EXPR above, will cause the IF test to fail so the
message box is not displayed?
Choice 1
-1
Choice 2
1
Choice 3
"1"
Choice 4
True
Choice 5
0
answer--5
------------------
7 What event is triggered by a Timer Control?
Choice 1
Tick
Choice 2
Interval
Choice 3
Timer
Choice 4
Activate
Choice 5
OnTime
ANSWER--3
------------------------
8 How do you create a multiple column ListBox?
Choice 1
Insert items as strings separated by tabs.
Choice 2
Set the Columns property to a value greater than 0.
Choice 3
The ListBox does not support multiple columns. You need to use a grid control to
accomplish this.
Choice 4
Set the TabStop to a value greater than 0 and the TabCount to a value greater than
0.
Choice 5
Use the AddColumn method at runtime.
ANSWER--2
------------------
9 What does the App.OLEServerBusyTimeout property control?
Choice 1
The number of times to retry an OLE request before returning a timeout result code
to the caller.
Choice 2
The number of seconds to retry an OLE request before the Component Busy dialog
box is displayed.
Choice 3
The number of milliseconds to retry an OLE request before the Component Busy
dialog box is displayed.
Choice 4
Sets the number of seconds to retry an OLE request before returning a timeout
result code to the caller.
Choice 5
Sets the number of milliseconds to retry an OLE request before returning a timeout
result code to the caller.
--------------------------
10 Before you can send mail using the MAPI tools, what must you do first?
Choice 1
MAPI is not used for sending mail.
Choice 2
Reboot windows.
Choice 3
Create a post office.
Choice 4
Establish your session by logging on.
Choice 5
Configure a mail gateway (SMTP).
ANSWER--4
----------------
11 Sample
Code
RC = Msgbox(A, B, C)
In the sample code above, RC will contain a value which is based upon user input
and which variable?
Choice 1
A
Choice 2
B
Choice 3
C
Choice 4
Defaults
Choice 5
It is not dependent on a variable.
ANSWER--2
-------------
12 MsgBox
MsgBox &O20
What is displayed by the MsgBox above?
Choice 1
"O20"
Choice 2
16
Choice 3
"&O20"
Choice 4
32
Choice 5
"20"
ANSWER---2
----------------------
13
How do you test for errors encountered while using the MultiMedia control?
Choice 1
Check the return value from the Command method.
Choice 2
Examine the completion code parameter passed to the Finished event after a
command has completed.
Choice 3
Using the standard VB Err.Number and Err.Description variables.
Choice 4
Examine the Error and ErrorMessage properties of the MultiMedia control.
Choice 5
It is not possible to trap errors that occur in the MultiMedia control unless the
Notify property is set to True.
------------------
14 Sample
Code
Open "C:\test.dat" For Binary as #1
How would you read data from the above file?
Choice 1
Peek #1, WStr
Choice 2
Line Input #1, WStr
Choice 3
Input #1, WStr
Choice 4
Read #1, WStr
Choice 5
Get #1,,WStr
----------------------
15 What is the purpose of the Visual Basic Sgn() function?
Choice 1
To signal a parent control that an event has taken place.
Choice 2
It returns an integer (-1, 0, or 1) depending on the sign of the argument.
Choice 3
It returns an integer (-1 or 1) depending on the sign of the argument.
Choice 4
It is a trigonometric function that computes the Sine of a given angle.
Choice 5
It returns a string indicating the sign of any numeric value "+", "-" or "0".
ANSWER--5
----------------------
16
How can a Masked Edit control be used to guarantee that bad dates are not
permitted?
Choice 1
Set MaskedEdit1.Mask to "##-##-####" and place code in the Validate event to
disallow non-date data.
Choice 2
Set MaskedEdit1.Mask to "##-##-####" and place code on form load event, Check
MaskedEdit.text with IsDate to disallow non-date data.
Choice 3
MaskedEdit1.Mask = "99-99-9999"
Choice 4
Set MaskedEdit1.Mask to "##-##-####" and place code in the KeyPress event to
disallow non-date values in the field.
Choice 5
MaskedEdit1.Mask = "##-##-####"
------------------
17
What is the correct and safest way to pass VB strings to a DLL function that is
expecting an LPSTR?
Choice 1
Make sure the last character in the string is an ASCII 0.
Choice 2
Specify the string argument as ByRef in the DLL function declaration.
Choice 3
Specify the string argument as ByVal in the DLL function declaration.
Choice 4
Don't specify either ByVal or ByRef in the DLL function declaration. VB will
determine the correct method to use.
Choice 5
VB strings can't be passed directly to DLL functions. You have to manually convert
them to byte arrays first.
---------------------
18 Sample
Code
Enum eFruits
apple = -1
pear
strawberry = 3
plum
orange
End Enum
Sub Main
Dim i As Long
For i = apple To orange
Debug.Print i;
Next i
End Sub
When Main() is executed in the IDE, what will be printed in the debug window?
Choice 1
-1 0 3 4 5
Choice 2
-1 5
Choice 3
0 1 2 3 4
Choice 4
-1 0 1 2 3 4 5
Choice 5
A type mismatch error. You can't mix the Long (i) with the Enum (eFruits)
ANSWER--4
------------------------------
19
How do you embed double quotes in a Visual Basic string?
Choice 1
Escape the " with a \ character. Example: "Bob said \"No!\"".
Choice 2
Escape the " with another " character. Example: "Bob said ""No""".
Choice 3
Use two single quotes in place of the " and VB will make the substitution
automatically.
Choice 4
Use the ` character in place of the " and VB will make the substitution
automatically.
Choice 5
It is not possible. The quote must be added using the Chr$() function.
ANSWER--2
------------------------
20 You have twenty text boxes on your form and wish to set their text properties to "0"
all at once. How can this be accomplished?
Choice 1
Right click on each text box.
Choice 2
Use the control key while clicking to select each of the items.
Choice 3
Use the Alt key while clicking to select each of the items.
Choice 4
Click and drag to "lasso" the text boxes.
Choice 5
You cannot do this. Text is not a "common property".
ANSWER--5
--------------------
21
You wish a BMP behind a Label control to be visible through the text. What do you
need to do?
Choice 1
Label1.Backcolor = vbTransparent
Choice 2
Label1.Backstyle = 1 'Opaque
Choice 3
Label1.Backstyle = 0 'Transparent
Choice 4
Label1.FontTransparent = True
Choice 5
Picture1.Zorder
Label1.Zorder
-----------------------
22 Sample
Code
Public X as Integer
Where is X available if the sample code above is in a BAS module called Mod1?
Choice 1
Only in Mod1.
Choice 2
Only in modules.
Choice 3
In Mod1 and forms.
Choice 4
Only in forms with Option Public.
Choice 5
To all code.
ANSWER--4
--------------------------------
23 Sample
Code
Dim Wdate as Date
Wdate = CDate(Text1.Text)
Assume the Windows short date is set to its default of "m/d/yy". In the sample
code above, if Text1 contains 06/19, what does Wdate contain on the date
7/4/1999?
Choice 1
06/19/99
Choice 2
06/19/00
Choice 3
06/19
Choice 4
06-19
Choice 5
An Invalid Date error occurs.
ANSWER--1
-------------------------------------
24
What looping construct is used to test the loop termination condition at the end of
the loop?
Choice 1
If Then
Choice 2
Do Loop Until
Choice 3
While Wend
Choice 4
For Next
Choice 5
VB does not provide a construct to accomplish this.
ANSWER--2
----------------------------
25 Sample
Code
Dim SQL as String
Dim RS as Recordset
SQL = "Select Max(DOB) as Mdob, Max(Wt) as Mwt from Staff"
Set RS = DB.Openrecordset(SQL)
Given the sample code above, how would you retrieve the value of the Max Date of
Birth (DOB)?
Choice 1
Ret = RS.Fields(1)
Choice 2
Ret = RS.Fields(Mdob)
Choice 3
Ret = RS.Fields("DOB")
Choice 4
Ret = RS.Fields!Mdob
Choice 5
Ret = RS.Fields!DOB
-------------------
26 Type Test
Dim x As TYPE
x = 3.14
x = x + 1
Debug.Print x
Which of the following replacements for TYPE will cause the sample code shown
above to produce 4?
Choice 1
String
Choice 2
Currency
Choice 3
Single
Choice 4
Date
Choice 5
Long
ANSWER--1
---------------------------
27 Your form has 4 unchecked check boxes. 1 and 2 are standard, and 3 and 4 are
graphical. A user clicks 3, then 1, and then 4. What happens?
Choice 1
The value of check boxes 3 and 4 are checked.
Choice 2
The value of check boxes 2 and 4 are checked.
Choice 3
The value of check box 4 is checked.
Choice 4
The value of check boxes 1 and 4 are checked.
Choice 5
The value of check boxes 1, 3, and 4 are all checked.
------------------
28 Sample
Code
Sub Main()
Dim i As Long
Dim coll As Collection
Dim obj As MyClass
Dim s As String
Set coll = New Collection
For i = Asc("a") To Asc("z")
Set obj = New MyClass
obj.MyProp = UCase$(Chr$(i))
coll.Add obj, Chr$(i)
Next i
Set obj = Nothing
s = coll(20).MyProp
s = s & coll.Item("e").MyProp
s = s & coll(11).MyProp
MsgBox s
End Sub
Assume MyClass is a class with a single read/write string property called MyProp.
What will be displayed in the message box when the sample code is executed?
Choice 1
20E10
Choice 2
T5K
Choice 3
TEK
Choice 4
TeK
Choice 5
20e10
------------------------
30 How do you set the caption on a scroll bar named Scrl1?
Choice 1
Scrl1.Caption = "Slide"
Choice 2
Scrl1.Text = "Slide"
Choice 3
Scrl1.Label = "Slide"
Choice 4
Scrl1.Title = "Slide"
Choice 5
None of the above
ANSWER--5