Professional Documents
Culture Documents
LESSON NOTES
UNIT III
ODBC and Data Access Objects: Data Access Options, ODBC, Remote data objects, ActiveX EXE and
ActiveX DLL: Introduction, Creating an ActiveX EXE Component, Creating ActiveX DLL Component.
Companies that needed real computing power turned to the mainframe computer, Which is a
centralized system architecture. The most salient feature of a centralized system is that the only
movement of marshalling are the keystrokes between the client and the host machine.
Excellent security
Demerits:
Expensive
of the mainframe.
KG College of Arts and Science 1 B.Sc.,Information Technology
Visual Basic
Application Logic
Data
Network Server
Keystrokes
Terminal
Characters
Terminal 1 Terminal 2 Terminal 3 Terminal 4
The file server system brought a complete change in the implementation of computer architecture. In
this system, the application logic was executed on the client workstation instead of the server.
Merits:
Low cost
Demerits:
Data
Network Server
Disk I/O requests
Disk Blocks
Client server architecture is a process involving a minimum of two independent entities. One is the
client and the other is the server. The client makes a request to the server and the server services the
requests and the resulting data is sent to the client.
The most popular client server applications revolve round the use of DBMS such as Oracle and Microsoft
SQL Server. These applications are referred to as back ends and offer support for storage, manipulation
and retrieval of business persistent data.
The query issued is not sent to the server. The logic of the query is processed and evaluated at the client
end itself. Only file I/O request is sent across the network to retrieve the required data in the form of
disk blocks.
The actual SQL statement is sent across the network and processed by an application running locally on
the server machine. As the SQL statement is processed on the server, only the results need to be sent
back to the client. Thus a major advantage of a client server is reduced network traffic and in most cases,
an incredibly quick execution time.
There is a need to an information system that can change with business needs m needs that mandate a
tighter budget and higher quality in addition to simply processing transactions and generating reports.
Business logic physically reside either on the client or be implemented on the back end.
Merits :
Demerits:
Less Flexible
Limitations:
Not Scalable
Unmanageable
Poor Performance
Improved model.
Service Location
Reuse
Performance
Manageability
Maintenance
DAO
Data Control
ODBC Direct
A Data Access Object is collection of object classes that model the structure of a relational database
system.
2 Libraries
Opening a Database
Syntax:
OpenDatabase (dbname,[options],[readonly],[connect])
Example:
Dim db as Database
Set db=OpenDatabase(“employee_details”)
Recordset
Creating a Recordset
a Recordset variable.
Example:
Dim rs as Recordset
Navigating a Recordset:
KG College of Arts and Science 9 B.Sc.,Information Technology
Visual Basic
Move methods
MoveFirst
MoveNext
MovePrevious
MoveLast
EOF
The EOF property is True when the user moves beyond the last record in the recordset.
BOF
The BOF pproperty is True when the user has moved to a position before the first record in the
recordset.
Edit Method
Update MEthod
AddNew Method
Delete Method
Finding Records
The Find methods can be used to locate a record in a dynaset or snapshot type Recrdset.
FindFirst
FindLast
FindNext
FindPrevious
The Seek method can be used to locate a record in a table type Recordset.
Execute method
OpenRecordset method
TableDef is a collection of Table objects that contain detailed definition about each data table in the
database.
OpenRecordset
RefreshLink
Create Property
CreateIndex
CreateField
New fields can be added or existing fields can be deleted using the Append or Delete method
Syntax:
Syntax:
ODBC
ODBC driver
3 parts
A Driver Manager
ODBC Driver
Client Application ODBC Data Source ODBC Driver
Manager
From the list of ODBC sources select ‘ODBC driver for Oracle’
Click OK
Syntax:
Dim db as Database
Tasks:
RowHeight
Arrow keys
ColIndex Property
Data1.Recordset.AddNew
End Sub
Data1.UpdateRecord
End Sub
Data1.Recordset.Delete
If Data1.Recordset.EOF Then
Data1.Recordset.MoveLast
End If
End Sub
Click Ok
Set connection=Environment.OpenConnection(dsName
[,Prompt[,readonly[,connect[,options]]]])
Dim cn as rdoConnection
Dim rs as rdoResultSet
B.Sc.,Information Technology
Visual Basic
Introduction
redistribute or duplicate
More efficient
3 Steps:
Step 1:
Property Settings
------------- -----------
Name Calculator
Instancing 5-Multiuse
Addn=A+B
End Function
Similar code can be written for Product, Subtraction, Division and Modulus operations
FileàSave Project As
CalClient.vbp
Create instances of the class calculator in the client application & invoke the function.
Add similar code to Sub, Prod, Div, Mod and run the Application.
Steps:
Design a form
Benefits:
Name : InterestCalculator
Instancing : 5-Multiuse
name it as Interest.bas
Option Explicit
Sub Main()
gdatserverstarted = Now
End Sub
Option Explicit
Sub Main()
gdatServerStarted = Now
End Sub
Dim R As Integer
R = 10
FixInterest = (P * R * T) / 100
End Function
Dim R As Single
R=8
RecInterest = (P * R * T) / 100
End Function
Dim R As Single
R = 7.5
CumInterest = (P * R * T) / 100
End Function