|
-
Nov 17th, 2004, 08:19 PM
#24
VB
1. Describe the GET, SET and LET methods
GET and LET are commonly used in VB when implementing Properties. GET is used to return the value of a property and LET is used to assign the value of a property.
SET methods is used to assign or instantiate a Class or an Object. Usually NEW key word is combined with SET method to create the instance.
e.g.
Dim obj as MyClass ‘define the variable
Set obj = New MyClass ‘assign/instanciate the MyClass to obj variable
2. Name 4 data types
String, Integer, Double
3. Describe the ‘collection’ object
Collection object is a type of variable which can be used to store any type of data. It is variable length data type which can be grow and reduce during the program execution. Elements can be added or removed at any time without effecting the other elements. Elements are accessed through the Index which starts with 0.
4. What are the four standard collection methods?
The four standard methods of the Collection objects are :
• Add
• Remove
• Count
• Item
5. “Implements” is a key word in VB6. What does it offer?
The Implements keyword is for implementing an ‘Interface’ in VB6. Though it is mainly used to simulate Inheritance in VB6.
6. “Public Function X()”. Define the scope of this function. Name two other ‘qualifiers’ and their scope.
The ‘Public’ qualifier makes the function X() public which means that this function is visible and can be accessed from any part of a VB project, or any other application (where this function is in a ActiveX dll). The other two ‘qualifiers’ that are available in VB are Private and Friend. The ‘Private’ qualifier means that only members residing on the same class/module/form can access this function, it will not be visible and accessible from other parts of the VB project or any other application. The ‘Friend’ qualifier in effect defines the function as public to for the entire project, but not to any external application or project. Note that private, public and friend can apply to classes, variable and property as well as function.
7. What is the difference between an in-process and out-of-process Active-X component?
In-process Active components are usually DLLs whereas out-of-process are ActiveX EXEs. There is also major difference on how they are loaded into memory. In-process ActiveX is loaded into the Client (the application that is using the DLL) memory. So if the DLL fails/crashes then it will cause the client application to crash too. On the other hand out-of-process ActiveX component are loaded into the memory as a separate thread and does not cause the client application to fail if the components crashes. There is also another different between these tow, in-process ActiveX loads faster then out-of-process ActiveX.
8. VB6 supports inheritance – True or False
False. (as it can only simulate inheritance but does not support it fully)
9. What determines when an object is disposed from memory?
In VB6 application object are disposed when:
• Object is out of scope
• The application is closed
• Set objectname = Null is used to dispose object
• Unload keyword is used to dispose object
10. What is wrong with the following code?
VB Code:
'* Take a string and replace all ‘A’s with ‘B’
Private Function ReplaceAwithB(ByRef sInput As String) As String
Dim sChar As String
Dim sCopy As String
Dim iCount As Integer
sCopy = ""
iCount = 1
If Len(sInput) > 0 Then
While iCount <= Len(sInput)
sChar = Mid(sInput, iCount, 1)
If sChar = "A" Then
sChar = "B"
End If
sCopy = sCopy & sChar
Wend
End If
ReplaceAwithB = sCopy
End Function
The above code creates a endless loop because the content of the variable iCount (the counter used to stop the loop) is never changed so that means then condition While iCount <= Len(sInput) will always remain true and the loop will execute endlessly. To fix this the following line will need to be added before the “Wend” line.
iCount = iCount + 1
DB Access / SQL
1. RDO, ADO, ODBC, DAO and OLE DB - What does each acronym stand for?
RDO – Remote Data Objects
ADO – ActiveX Data Objects
ODBS – Open DataBase Connectivity
DAO – Data Access Objects
OLE DB – Object Linking and Embedding DataBase
2. What is a stored procedure? Why might it be a useful entity?
Stored procedures are complex SQL queries, which are pre-compiled and stored. This means it runs much faster then standard SQL queries. Stored Procedure allows to execute many sets of SQL statements and then finally return the result as data sets. It is useful as it allows to perform many sets of action in one Stored Procedure. For example, before adding a Row, validation can be preformed to check the data integrity.
3. What is a trigger?
A trigger is similar to a stored procedure but a trigger only gets executed when certain action such as Add, Delete or Update is performed. A trigger is usually assigned to a Table so a particular trigger is executed when those action is performed on that specified Table. Triggers are used to perform background task, logging, data update and various other ways.
4. What are the two security models supported by MS SQL Server?
• The two security models supported by MS SQL Server are:
Windows Authentication Mode
• SQL Server Authentication Mode
5. Name two ways in which you can get a value returned from a stored procedure.
• Using ‘Output’ parameter
• Use Return in the Stored procedure to return value (Also Select statement can be used to return value) and assign the returned value to a Recordset
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|