Introduction to Visual Basic Programming: Data Types, Functions, and Data Controls, Summaries of Computer Science

A comprehensive introduction to visual basic programming, covering fundamental concepts such as data types, functions, and data controls. It explores the different data types available in visual basic, including numeric, string, date, and boolean types, and explains their characteristics and usage. The document also delves into string handling functions, date and time functions, and the use of data controls for connecting to databases. It offers a clear and concise explanation of these concepts, making it a valuable resource for beginners learning visual basic.

Typology: Summaries

2023/2024

Uploaded on 10/24/2024

hugger
hugger 🇺🇸

4.8

(12)

916 documents

1 / 79

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Client-Server Architecture and
Visual Basic Concepts
Software Development with Visual Basic
Introduction to Client/Server
Studocu is not sponsored or endorsed by any college or university. This
document covers the syllabus for the B.Com. (Computer Applications) - III
Year Core Paper-14 on "Software Development and Visual Basic" from
Bharathiar University.
The objectives of this course are to enable students to develop a front-end
tool for Customer Interaction in Business. The course covers the following
topics:
Unit I: Introduction to Client/Server
Client/Server: Benefits, Downsizing, Upsizing, and Rightsizing
Client/Server Models: Distributed Presentation, Remote Presentation,
Remote Data, Distributed Logic, and Distributed Data
Client/Server Architecture: Technical Architecture and Application
Architecture
Two-Tier Architecture and Three-Tier Architecture
OLTP and n-Tier Architecture
Unit II: Introduction to Visual Basic
Steps in VB Application Development
Integrated Development Environment (IDE): Menu Bar, Toolbar, Project
Explorer Window, Property Window, and Toolbox
Properties, Methods, and Events
Event-Driven Programming
Working with Forms: Variables, Scope of Variables, Constants, and Data
Types
Unit III: Visual Basic Programming Concepts
Functions and Procedures
Control Structures: If, Switch, Select, For, While, Do While
Arrays and User-Defined Data Types
Data Type Conversions
Operators and String Functions
Date and Time Functions
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f

Partial preview of the text

Download Introduction to Visual Basic Programming: Data Types, Functions, and Data Controls and more Summaries Computer Science in PDF only on Docsity!

Client-Server Architecture and

Visual Basic Concepts

Software Development with Visual Basic

Introduction to Client/Server

Studocu is not sponsored or endorsed by any college or university. This document covers the syllabus for the B.Com. (Computer Applications) - III Year Core Paper-14 on "Software Development and Visual Basic" from Bharathiar University.

The objectives of this course are to enable students to develop a front-end tool for Customer Interaction in Business. The course covers the following topics:

Unit I: Introduction to Client/Server

Client/Server: Benefits, Downsizing, Upsizing, and Rightsizing Client/Server Models: Distributed Presentation, Remote Presentation, Remote Data, Distributed Logic, and Distributed Data Client/Server Architecture: Technical Architecture and Application Architecture Two-Tier Architecture and Three-Tier Architecture OLTP and n-Tier Architecture

Unit II: Introduction to Visual Basic

Steps in VB Application Development Integrated Development Environment (IDE): Menu Bar, Toolbar, Project Explorer Window, Property Window, and Toolbox Properties, Methods, and Events Event-Driven Programming Working with Forms: Variables, Scope of Variables, Constants, and Data Types

Unit III: Visual Basic Programming Concepts

Functions and Procedures Control Structures: If, Switch, Select, For, While, Do While Arrays and User-Defined Data Types Data Type Conversions Operators and String Functions Date and Time Functions

Unit IV: Visual Basic Controls and User Interface

Standard Controls: Form, Label, Textbox, Command Button, Checkbox, Option Button, List Box, Combo Box, Picture Box, Image Controls, Scroll Bar, Drive List Box, Directory List Box, Time Control, Frame, Shape, and Line Controls Control Arrays Dialog Boxes: Single Document Interface (SDI) and Multiple Document Interface (MDI) Menus and Menu Editor

Unit V: Data Access in Visual Basic

Data Controls and Data Access Objects (DAO) Accessing and Manipulating Databases Recordset: Types, Creation, Modification, Deletion, and Finding Records Data Report: Data Environment, Report Designer, Connection Object, Command Object, and Data Report Controls

Client Server Technology: An Introduction

1.1 Introduction

The term "client/server" was first used in the 1980s in reference to personal computers (PCs) on a network. The client/server software architecture is a versatile, message-based and modular infrastructure that is intended to improve usability, flexibility, interoperability, and scalability as compared to centralized, mainframe, and time-sharing computing. In a client/server model, one program (the client) makes a service request from another program (the server), which fulfills the request. The client/server model provides a convenient way to interconnect programs that are distributed efficiently across different locations in a network. Computer transactions using the client/server model are very common, such as checking a bank account from a personal computer. Many major online information and e-commerce services, as well as campus services, follow the client-server file sharing model.

1.2 Definitions

The client/server system is defined in terms of individual pieces that work together as a whole, integrating hardware, software, and networking to share resources and support business functions in multiple locations. The Internet itself is the world's largest client/server system, comprising thousands of clients and servers transferring information and supporting millions of business functions across a global network.

Integrity: The centralized maintenance of client and server code results in cheaper maintenance and the guarding of shared data integrity.

1.7 Client-Server Configuration

The client/server model is more important in a network, as it provides a convenient way to interconnect programs distributed across different locations. The same device may function as both client and server, and a device that is a server at one moment can reverse roles and become a client to a different server. Common applications that follow the client/server design include email clients, FTP clients, and web browsers. Client/server systems can be configured in various ways, with the most common being the two-tier and three-tier architectures.

Advantages of Client-Server Model

Resource Sharing

In the client-server model, resources such as data, applications, and computing power are centralized on the server, allowing clients to access them as needed.

Communication

The client-server architecture facilitates communication between different systems and devices, enabling the exchange of information and collaboration.

Groupware

Client-server systems support groupware applications that allow multiple users to work together on shared documents, projects, and tasks.

Management Control

The centralized nature of the client-server model allows for better management control, as administrators can manage and maintain the system from a central location.

Reduced Costs - Downsizing

The client-server model enables organizations to downsize from expensive mainframe systems to cheaper client-server systems, potentially reducing overall costs.

Support for Business Environmental Changes

The flexibility of the client-server model allows organizations to adapt to changing business requirements and environmental conditions more easily.

Improved Information Accessibility

Clients can access information and resources from the server more easily, improving overall information accessibility.

Faster/Better Information

The client-server architecture can provide faster and more efficient access to information, leading to better decision-making and improved business outcomes.

Open Architecture - Compatibility Issues

The client-server model often utilizes open architectures, which can help address compatibility issues and enable integration with a wider range of systems and technologies.

Empowered Users

Clients in the client-server model can have more control and autonomy in accessing and using the resources and applications provided by the server.

Benefits and Risks of Client-Server File

Sharing

Benefits of Client-to-Server File Sharing

Central Administration and Security : The client-server model centralizes the administration and security of data distribution, allowing system administrators to manage these aspects more effectively. Secure Connections : Clients can use encryption methods like SSL, SSH, and others to securely connect to the server and access files or data. Automatic Security Requirements : Many server-based file and data sharing services, such as NetFiles, Express Email, Illinois Compass, and Banner, automatically require secure connections, simplifying the security process for users.

Calculations comparing the costs of an IBM mainframe and an HP UNIX system showed similar per-user costs over a five-year period, with the mainframe having a slight advantage.

Applications Software

Downsized platforms may have a cost advantage in terms of applications software, as they can leverage more off-the-shelf packages. However, mainframes are generally configured for sub-second response times, which can increase the cost of downsized platforms to achieve similar performance.

Personnel

Mainframe configurations require more dedicated technical staff, such as operators and systems programmers, which can increase the personnel costs. Downsized platforms may require fewer technical staff, but the cost of supporting a typical client-server environment can still be significant, especially for PC LANs.

In summary, the true cost of mainframes is a complex issue that involves considering various factors beyond just the raw processing power or MIPS rating. The centralized data handling capabilities, applications software requirements, and personnel costs all play a role in determining the overall cost-effectiveness of mainframe systems compared to downsized client- server architectures.

The Hidden Costs of Downsizing

Perceived vs. Actual Costs

According to the provided information, there is a significant discrepancy between the perceived and actual costs of various IT components:

Hardware: Perceived 60%, Actual 20% Software: Perceived 20%, Actual 10% Supplies: Perceived 5%, Actual 5% Maintenance: Perceived 5%, Actual 5% Outside Help: Perceived 5%, Actual 15% Support: Perceived 5%, Actual 45%

The data suggests that outside help and internal support cost sixteen times more than the users suspect, relative to the hardware and software.

Productivity and PC Penetration

The text states that white-collar productivity in the United States, which has the world's highest per capita penetration of PCs, increased by just 0.2% in the last decade. In contrast, Japan, which has the lowest penetration of PCs of any developed country, recorded a far higher productivity growth.

Additionally, a study published in Information Week found "a negative relationship between the proportion of users who have PCs and IS effectiveness. Highly effective IS organizations have fewer PCs per worker than ineffective ones."

Mainframe vs. Downsized Platforms

The "Dinosaur Study Totals" section provides a comparison of cost ranges for different IT systems:

IBM Mainframes: £5285 to £ Proprietary Minis: £7306 to £ UNIX Minis: £7180 to £ PCs on LANs: £9400 to £15,

The data indicates that the final numbers are even more skewed towards giving mainframes the advantage over downsized platforms.

Additionally, a separate study published in the IBEX Bulletin surveyed MIS managers and found the following total costs for different system types:

AS/400: $ Proprietary Minis: $ UNIX Minis: $ Mainframes: $ PC LANs: $

Concerns with Downsizing

The text outlines several concerns associated with downsizing, including:

Data Integrity

Mainframes have a very high level of data integrity, with over 95% of mainframe crashes resulting in no significant data loss. In contrast, the typical minicomputer or PC environment often relies on the user to back up data before going home.

Decentralization

Downsizing is typically accompanied by the decentralization of data, which can lead to a lack of central control over systems administration, data security, backup, recovery, and other data center functions.

Partitioning

With client/server technologies, knowing how to partition application logic between client and server nodes can be very confusing, and once the partitioning is hard-coded, it can be difficult to change.

Access Projects (.adp)

Access Projects (available in Microsoft Access 2000 and higher) allow more 'native' integration with Microsoft SQL Server. Access Projects (.adp) provide data access using ADO.

Comparison of ODBC and Access Projects

ODBC integration can be integrated with (almost) any RDBMS (Relational Database Management System), while Access Projects have native support only for Microsoft SQL Server.

The Role of Access

Access serves as a database frontend with the full features of the Microsoft Access JET Engine and VBA (Visual Basic for Applications). In the case of Access Projects, Access serves as a database frontend with limited functionality. Local tables are not allowed. Queries are generally transformed into database views, and VBA code manipulating the data is transformed into procedures stored on the server, similar to a thin client architecture.

Performing the Upsizing

Upsizing a Microsoft Access database to a SQL server requires fundamental refactoring of the database structure and source code. Even though the Upsizing Wizard automates some aspects of this procedure, there are still many points requiring human intervention.

Changes Required During Upsizing

Complete change of the data access interface from DAO (Data Access Objects) to ADO. Substantial change of Microsoft JET SQL to Transact-SQL. Substantial adaptation of object (e.g., tables, columns, etc.) names.

Reconception of the Source Code to Optimally

Employ the New Functionality of ADO and

Microsoft SQL Server of the 'Upsized' Solution

RIGHTSIZING

The goal of Rightsizing is to determine the right platform (microcomputer/ network, Client/Server, mainframe/minicomputer) for an application. Rightsizing seeks to provide the best blend of application performance, usability, and cost containment. Generally, the two factors to consider when Rightsizing are:

Database size

Amount of user interaction

If both of these factors are large, Client/Server is the appropriate platform. If the database is large and user interaction is minimal, a mainframe/ minicomputer is the appropriate platform. If the database is small and user interaction is constant, a microcomputer/network is the appropriate platform (although security and data integrity issues may affect this decision).

The Application Platform Worksheet can be used as a guideline for the selection of the Rightsize platform. It assigns weights to the database size and the user interaction, adds an optional amount for security & fault tolerance, then indicates the range of results appropriate to each platform. If the application falls within a range where two platforms overlap, then either platform can be used. Leverage the investment in existing equipment by selecting the platform that is most readily available.

The primary goal of Rightsizing onto the mainframe/minicomputer is to leverage existing computer resources, not to encourage the purchase of new mainframe/minicomputer equipment. Today's Client/Server hardware technology can provide performance and fault tolerance equivalent to all but the newest mainframe/minicomputers, at a fraction of the cost. Client/ Server's cost efficiency makes it extremely difficult to justify the purchase of a mainframe/minicomputer. The businesses that would require the type of processing power embodied in the newest mainframe/minicomputers are very, very few. The vast majority of businesses will easily accomplish their business goals with Client/Server technology.

In the event of a miscalculation or a change in direction, Client/Server equipment can always be redistributed in a useful manner. The organizations buying used mainframe/minicomputers have become few and far between, and salvage for scrap metal is a painful way to dispose of a mainframe/minicomputer.

Businesses usually discover that the Rightsizing process tends to move strategic applications from the mainframe/minicomputer onto Client/Server platforms. This migration frees expensive resources on their existing mainframe/minicomputer, allowing them to leverage their current mainframe/minicomputer investment and avoid expensive upgrades. Some businesses, after Rightsizing their strategic applications, determine that they can completely eliminate the mainframe/minicomputer, eliminating existing maintenance contracts, and actually reducing their ongoing operating expense.

The initial step is to Rightsize all new applications. Their tendency towards Client/Server will ease the load on the mainframe/minicomputer, allowing its existing backlog of requests to be serviced, and heading off any expensive upgrades that would have otherwise been necessary. As the personnel gain experience with the Client/Server environment, they can start Rightsizing existing applications, with an eye towards enhancing business capabilities and reducing ongoing operating expenses.

CLIENT SERVER ARCHITECTURE

Components of the Client Server Computing

The components of the client-server computing can be grouped into four categories of architecture:

Business solutions architecture Application architecture Platform architecture Technical architecture

Application Architecture

The application architecture layer can be defined as those services that perform business functions on the computer. It represents the components that provide the automation support for a business function or activity in the business process (but does not include the platform and cross-application architecture). For example, a manufacturer's sales and marketing system application architecture could include a sales tracking application and the distributed data architecture to support both networked sales offices and mobile sales people.

Technical Architecture

The technical architecture consists of the infrastructure and systems software layers. The differentiation between them is primarily a question of make-to-buy, which is a key decision for organizations intent on building an architecture. An organization can choose to build a great deal, thereby making the architecture very close to what it wants. That means that there is a great deal of logic being built by the organization. To the extent that business or application demands make it necessary for the tools to be integrated, developers can then do simple assembly, or "gluing together," of the pieces.

The decision for most organizations depends on balancing demands. On the one hand, the organization has a large front-end commitment to build and an ongoing commitment to maintain the infrastructure architecture; on the other hand, the organization has a tool that is exactly what it wants. This is especially the case as the market matures with more technical entrants. By purchasing rather than building, they can then more easily apply their strong skills in the application architecture business.

Components of a Technical Architecture

An execution architecture describes the components required when an application executes. An operations architecture describes the components required to operate and manage the system.

These architectures must be flexible enough to accommodate a wide range of technologies, but they must also be structured enough to provide valuable guidelines and ensure that interoperability is available where it is required.

TYPES OF ARCHITECTURE

When considering a move to client/server computing, whether it is to replace existing systems or introduce entirely new systems, practitioners must determine which type of architecture they intend to use. The vast majority of end-user applications consist of three components: presentation, processing, and data. The client/server architectures can be defined by how these components are split up among software entities and distributed on a network. There are a variety of ways for dividing these resources and implementing client/server architectures. This paper will focus on the most popular forms of implementation of two-tier and three-tier client/server computing systems.

2-Tier and 3-Tier Client/Server Architectures

Every client/server application contains three functional units:

Presentation logic or user interface (for example, ATM machines) Business logic (for example, software that enables a customer to request an account balance) Data (for example, records of customer accounts)

These functional units can reside on either the client or on one or more servers in your application. Which of the many possible variations you choose depends on how you split the application and which middleware you use to communicate between the tiers.

Two-Tier Architecture

In a two-tier client/server implementation, the three components of an application (presentation, processing, and data) are divided among two software entities (tiers): client application code and database server. A robust client application development language and a versatile mechanism for transmitting client requests to the server are essential for a two-tier implementation.

Presentation is handled exclusively by the client, processing is split between client and server, and data is stored on and accessed via the server. The PC client assumes the bulk of responsibility for application (functionality) logic with respect to the processing component, while the database engine - with its attendant integrity checks, query capabilities and central repository functions - handles data-intensive tasks.

In a data access topology, a data engine would process requests sent from the clients. Currently, the language used in these requests is most typically a form of SQL. Sending SQL from client to server requires a tight linkage between the two layers. To send the SQL, the client must know the syntax of the server or have this translated via an API (Application Program

Since the bulk of application logic exists on the PC client, the two-tier architecture faces a number of potential version control and application re- distribution problems. A change in business rules would require a change to the client logic in each application in a corporation's portfolio which is affected by the change. Modified clients would have to be re-distributed through the network, which can be a potentially difficult task given the current lack of robust PC version control software and problems associated with upgrading PCs that are turned off or not 'docked' to the network.

System security in the two-tier environment can also be complicated, as a user may require a separate password for each SQL server accessed. The proliferation of end-user query tools can also compromise database server security, as users may be able to access otherwise hidden fields or tables and possibly corrupt data using such tools.

Additionally, the client tools and the SQL middleware used in two-tier environments are highly proprietary, and the PC tools market is extremely volatile. This kind of volatility raises questions about the long-term viability of any proprietary tool an organization may commit to, as migration from one proprietary technology to another would require a firm to scrap much of its investment in application code, since none of this code is portable from one tool to the next.

Three-Tier Architecture

In contrast to two-tier architecture, in three-tier client/server applications, the business logic resides in the middle tier, separate from the data and user interface. This allows processes to be managed and deployed separately from the user interface and the database. Additionally, three-tier systems can integrate data from multiple sources.

The three-tier architecture is generally split up between:

The client (user interface) The middle tier (business logic) The data tier (database)

This separation of concerns allows for greater flexibility, scalability, and maintainability compared to the two-tier architecture.

Three-Tier Architecture

The Three-Tier Architecture

Client : The computer that requests the resources, equipped with a user interface (usually a web browser) for presentation purposes.

Application Server (Middleware) : The server responsible for providing the requested resources by calling on another server.

Data Server : The server that provides the application server with the required data.

The three-tier architecture (Figure 3) attempts to overcome some of the limitations of the two-tier scheme by separating presentation, processing, and data into separate, distinct software entities (tiers).

Advantages of Three-Tier Architecture

Flexibility : The calling mechanism from client to server in a three-tier system is typically the remote procedure call (RPC), which provides greater overall system flexibility than the SQL calls made by clients in the two-tier architecture.

Openness : The three-tier presentation client is not required to 'speak' SQL, allowing the organization, names, or structure of the back-end data to be changed without requiring changes to the PC-based presentation clients.

Parallel Development : Separate software entities can allow for the parallel development of individual tiers by application specialists.

Flexible Resource Allocation : Middle-tier functionality servers are highly portable and can be dynamically allocated and shifted as the needs of the organization change.

Reduced Network Traffic : Middle-tier functionality servers can strip data to the precise structure required before distributing it to individual clients at the LAN level, reducing network traffic.

Code Reuse : Modularly designed middle-tier code modules can be re- used by several applications, reducing subsequent development efforts, maintenance workload, and migration costs.

Drawbacks of Three-Tier Architecture

Immature Tools : Current tools for three-tier architecture are relatively immature and require more complex 3GLs for middle-tier server generation.

Maintenance Challenges : Many tools have under-developed facilities for maintaining server libraries, which can be a potential obstacle for simplifying maintenance and promoting code re-use.

Increased Complexity : More code in more places increases the likelihood that a system failure will affect an application, requiring detailed planning with an emphasis on the reduction/elimination of critical-paths.

Network Management : Three-tier architecture brings an increased need for network traffic management, server load balancing, and fault tolerance.

OLTP systems work behind the scenes to store and manage all these transactions in real-time, providing an immediate response.

Characteristics of OLTP

Handles active data instantly Ensures multiple transactions are processed accurately and efficiently Provides immediate response Used in applications such as banking, airlines, mail-order firms, manufacturers, and retailers

OLTP is a key component of distributed computing, contrasting with Decision Support Systems (DSS) which focus on data mining for trends, quick answers, and summaries.

Introduction to Visual Basic

1.1 Steps in Visual Basic Application

New : This tab enables the creation of a new project or application, choosing from an assortment of templates or wizards.

Existing : This tab enables the selection of an existing project, displaying a Windows file open dialog box.

Recent : This tab lists the Visual Basic projects that have been used recently.

Don't show this dialog in the future check box: Selecting this option will prevent this dialog box from being displayed when Visual Basic is started in the future. However, from the File > New Project menu option, one will not receive the Existing and Recent tabs.

Whenever a project is opened or a new project is started, the Visual Basic 6.0 Integrated Development Environment (IDE) window will appear. The IDE window consists of the following different parts:

1.1.1 Creating A Project In Visual Basic

When Visual Basic is started, the New Project dialog box appears, providing options to create a new project, open an existing project, or access recently used projects. The user can choose the appropriate option to begin the development process.

1.2 The Parts Of A Visual Basic Project

The Visual Basic IDE window consists of various components that work together to facilitate the development of applications. These components include:

2.1 Integrated Development Environment (IDE)

2.2 Menu bar

2.3 Toolbar

2.4 Form Window

2.5 Project Explorer Window

2.6 Property Window

2.7 Form Layout Window

2.8 Toolbox

2.9 The form designers and Code window

2.10 Help in Visual basic

3.1 Methods and events

3.2 Event Driven programming

3.3 Working with forms

3.4 Variables

3.5 Scope of variables

3.6 Constants

3.7 Data types

The text provided covers the introduction to Visual Basic, the steps involved in creating a Visual Basic application, and the various components that make up a Visual Basic project. It explains the New Project dialog box, the Integrated Development Environment (IDE), and the different parts of the IDE window, such as the menu bar, toolbar, form window, project explorer, property window, form layout window, toolbox, form designers, code window, and help. The text also introduces concepts like methods, events, event- driven programming, working with forms, variables, scope of variables, constants, and data types.