• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/25

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

25 Cards in this Set

  • Front
  • Back
When a variable is defined at the form level as Private dblVehId as double, what is the widest range from which dblVehID can be referenced?
widest range from which dblVehID can be referenced?
a)Within the form
b)Within all procedures
c)Globally
d)None of the above
a)Within the form
Assume you have a DataEnvironment object with a Connection object named conOracle. It contains two Command objects named cmdEmployee and cmdCustomer. frmEmployee has controls bound to cmdEmployee, and frmCustomer has controls bound to cmdCustomer. Both are open and both are editing Recordset objects derived from the two Command objects. In frmCustomer, the user presses a CommandButton control. In the event procedure, your code executes a RollbackTrans method. Next, the user clicks on a CommandButton control on frmCustomer, where your event procedure executes a CommitTrans method. Which of the following statements is true?
a) Changes to cmdEmployee are saved, but changes to cmdCustomer are lost.
b) Changes to cmdEmployee are lost, but changes to cmdCustomer are saved.
c) Changes to both cmdEmployee and cmdCustomer are lost.
d) Changes to both cmdEmployee and cmdCustomer are saved.
c) Changes to both cmdEmployee and cmdCustomer are lost.
You have created an ActiveX control. The InvisibleAtRuntime property was set to True when you created it. It performs some currency exchange calculations for your order-entry application. The ActiveX control has a bug in it that causes it to crash every once in a great while with no discernible pattern. Because the crashes are so rare, you elect to proceed with the rest of your project and figure that some day (maybe after next year's Super Bowl), you'll get around to figuring out what the bug is.
You will include the ActiveX control as part of a COM component that is to be used by your order-entry application. The COM component is responsible for connecting to the database and retrieving, validating, and editing records. The COM component will also include code to validate user passwords and assign a "security level." (The security level is used to determine which screens the user is allowed to see and whether or not he or she can update the data.)
The order-entry application will leave almost all business logic to the COM component and will consist mainly of the user interface (forms, menus, and so forth). The COM component will be shared by multiple users on an application server.
What type of Visual Basic project will you choose to create the COM component?
a) ActiveX control
b) COM DLL
c) COM EXE
d) Standard EXE
c) COM EXE
Describe ByVal arguments in a DLL function declaration.
a)Exact values
b)Object variables
c)Unicode values
d)Callback pointers
a)Exact values
Consider the following code:
Dim sName()
ReDim sName(5)
sName(3) = "Smith"
Erase sName
Which of the following statements is true?
a) All memory is released. The array sName needs to be declared again using ReDim before it can be reused.
b) All memory is released. You can immediately reuse the array sName without further action.
c) The first four elements of the array sName are initialized (to empty strings), but not all memory is released. You can immediately reuse the
first four elements of the array but have to use ReDim if you need to make the array larger.
d) You will receive an error message.
a) All memory is released. The array sName needs to be declared again using ReDim before it can be reused.
What does the GetSetting function do?
a)Retrieves values from a property
b)Retrieves values from the registry
c)Retrieves environment variables
d)None of the above
b)Retrieves values from the registry
Assume that you create a new Visual Basic project, choosing an ActiveX control as the project type. To your control, you add the UpDown control followed by a ComboBox control and then a TextBox control. You set the properties of the UpDown control as follows:
AutoBuddy = True
BuddyProperty = Text
Min = 0
Max = 10
Next, you run the project and click on the up arrow on the UpDown control. Which of the controls on the form will change its display?
a) The ComboBox control
b) The TextBox control
c) The UpDown control
d) None of the above
a) The ComboBox control
What functions can be used to record values in the Registry?
a)RegSave
b)SaveSetting
c)WriteSetting
d)SaveValues
b)SaveSetting
Your form has two TextBox controls occupying the exact same space (one is on top of the other). Assuming the following code snippet, with which TextBox control(s) can the user interact (that is, into which TextBox control[s] can the user type)?
Private Sub Form_Load()
Text2.ZOrder 1
Text1.ZOrder 0
End Sub
a) Both
b) Text2
c) Text1
d) The one with the lowest ZOrder property, assuming the TabIndex for both is non-zero
a) Both
Consider the following code:
form1.Show
Dim newFrm As form1
unload form1
What memory is used by the object(s) remaining in memory (do not consider the few bytes of overhead to reference the object variable)?
A) None. The form has been removed from memory.
B) None. Visual Basic will generate an error.
C) The memory used by form1 is still being used.
D) A 16-bit "orphan" pointer (newFrm) is still being used.
C) The memory used by form1 is still being used.
You wish to boldface the text on every command button on every open form in your application. Which code snippet will accomplish this?
A) Visual Basic does not support this functionality.
B) Dim vButton As Variant
For Each vButton In Controls
If TypeOf vButton Is CommandButton _
Then
vButton.FontBold = True
End If
Next
Next
C) Dim iButton As Integer
Dim iForm As Integer
For iForm = 1 to UBound (Form)
For iButton = 1 to UBound _
(Form.CommandButton)
Form.CommandButton _
(iButton).FontBold = True
Next
Next
D) Dim vForm As Variant
Dim vButton As Variant
For Each vForm In Forms
For Each vButton In vForm.Controls
If TypeOf vButton = CommandButton Then
vButton.FontBold = True
End If
Next
Next
D) Dim vForm As Variant
Dim vButton As Variant
For Each vForm In Forms
For Each vButton In vForm.Controls
If TypeOf vButton = CommandButton Then
vButton.FontBold = True
End If
Next
Next
Which of the following are in-process COM components? [Check all correct
answers]

a) ActiveX DLL
b) ActiveX EXE
c) ActiveX control
d) Standard EXE
e) None of the above

a) ActiveX DLL
c) ActiveX control
You have a form with a single TextBox control. As you can see in Exhibits 1
and 2 (Figures 15.1 and 15.2), the Cut and Copy menu items are enabled when
text is highlighted and disabled when text is disabled. Where is the most
likely place that the author attached code to accomplish this?
a) The TextBox control's Change event procedure.
b) The TextBox control's Select event procedure.
c) The Edit menu's Click event procedure.
d) The Edit Cut and Edit Copy menus' Click event procedures.
e) The menu's Activate event procedure.

c) The Edit menu's Click event procedure.
You want to step through the code contained in your ActiveX Control project line by line when in break mode. How can this be accomplished?
a) Open a second instance of Visual Basic, start a Standard EXE project, and add an instance of the control to the project.
b) Compile the control, create a new Standard EXE project, and add a reference to the control.
c) Add a Standard EXE project to your project to create a project group. Add an instance of the control to a form in the added project and step through the code like normal.
d) Run the control project and choose the Step Through option on the debug toolbar.
c) Add a Standard EXE project to your project to create a project group. Add an instance of the control to a form in the added project and step through the code like normal.
Assume rs is an open ADO Recordset object consisting of 37 rows. Further, assume that it supports forward and backward navigation, bookmarks, and record counts. What will happen when the following code executes?
Dim iRecNo As Integer
With rs
iRecNo = .RecordCount MOD 9
.MoveFirst
.Move iRecNo
If .Bookmarkable Then
Dim vBookmark As Variant
vBookmark = .Bookmark
.MoveLast
.Bookmark = vBookmark
End If
End With
a) The first record will be current.
b) The second record will be current.
c) EOF will be True.
d) BOF will be True.
e) Both BOF and EOF will be True.
f) An error will occur.

f) An error will occur.
You have a form with four text boxes on it and need to intercept keystrokes for all four text boxes. Which of the following solutions is best?
a) Use the KeyPreview method of the form.
b) Use the TestKey event of the OLE keyboard object inserted into the form.
c) Use the KeyDown or KeyPress events of each of the text boxes.
d) Use the KeyDown or KeyUp properties of the form.
e) None of the above.
c) Use the KeyDown or KeyPress events of each of the text boxes.
You have created several Watch variables to assist in debugging your application. When looking at the values for Watch variables configured with limited scopes, you notice an unusual value assigned to the variables when they are currently out of scope. What is that value?
a) <out of range>
b) <out of context>
c) <out of scope>
d) Null
b) <out of context>
Your application has opened an ADO Recordset. In your code, you have coded an error handler that specifies On Error Resume Next followed by a line of code that invokes the MoveLast method of the Recordset object. Under which of the following circumstances might there be no records?
a) When EOF is True and BOF is False
b) When BOF is True and EOF is False
c) When both BOF and EOF are True
d) When both BOF and EOF are False
c) When both BOF and EOF are True
You create a COM DLL with Visual Basic and write a client program that references certain methods of the objects exposed by the DLL. The objects are explicity declared. What type of binding will result?
a) DispID
b) vTable
c) DispID if the COM DLL's Project Properties specified an apartment model
d) There is not enough information provided to determine what type of binding will occur
e) None of the above
b) vTable
How would you access an ODBC data source with the ADO Data control?
a) Use the RDO UserConnection interface.
b) Use the OLEDB Provider for ODBC.
c) Set the DefaultCursor property to ODBCDirect.
d) Use a translation table with SQL Server.
b) Use the OLEDB Provider for ODBC.
A Data Link creates which object(s)?

a) Command
b) Connection
c) Recordset
d) Either a or c
b) Connection
Which of the following will add a Node object to a TreeView control?
a) Dim myNode As Node
Set myNode = TreeView1.Nodes.Add(,,"C:\","Root")
b) Treeview1.Add ("C:\",tvwParent)
c) TreeView.Node.Add ("C:\",tvwParent, tvwTextOnly)
d) TreeView.AddNode ("C:\", tvwParent)
a) Dim myNode As Node
Set myNode = TreeView1.Nodes.Add(,,"C:\","Root")
Which is not an event of the TextBox control?
a) GotFocus
b) MouseMove
c) Validate
d) None of the above
d) None of the above
How can the actions and visual interface of the Package and Deployment Wizard be customized?
a)Modify the setup toolkit project.
b)Modify setup.lst.
c)Modify setup.stf.
d)Edit setup.ini.
a)Modify the setup toolkit project.
What does it mean when a component is marked as Safe for Scripting in the Package and Deployment Wizard?
a)The component is now capable of being used in Netscape.
b)The component is now capable of being called by VBscript code.
c)The component should not be capable of doing any damage on systems.
d)The component is not compiled.
c)The component should not be capable of doing any damage on systems.