Visual Basic Database Access

Slides:



Advertisements
Similar presentations
Basics of Database Programming with VB6
Advertisements

Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
1 Chapter 12 Working With Access 2000 on the Internet.
VB.NET Database Access ISYS546. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
The ADO Data Control. Universal Data Access Open Database Connectivity (ODBC) –standard for accessing data in databases OLE-DB –allows access to data.
ActiveX Data Object ISYS 562. ADO An ActiveX control ActiveX is build upon COM, a contract that defines a standard interface by which objects communicate.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Using Objects and Properties
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
VB.NET Database Access ISYS 812. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
Visual Basic Database Access BICS546. Microsoft Universal Data Access OLE DB: The OLE database protocol –Allows a program to access information in any.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab10 Interacting with Data (Database Management)
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
VB.NET Database Access ISYS546. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
Database Programming (using ADO) Universal Data Access – Microsoft strategy for providing access to information across the enterprise. – UDA provides high-performance.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Introduction to ADO.Net and Visual Studio Database Tools
Chapter 8 Relational Databases ActiveX Database Controls 8 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
VB.NET Database Access ISYS546. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Integrate. Automate. eXLerateTM
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
ActiveX Data Object (ADO) in JavaScript J.L.Wang, Yen-Cheng Chen Dept. of Infomation Management Ming-Chuan University Jan
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Introduction to ADO By David R. Stevenson Consulting Software Engineer ABB Automation.
Handling of data from multiple databases. Visual Basic Database Visual Basic application acts as a front-end to the database Visual Basic application.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Using Visual Basic 6.0 to Create Web-Based Database Applications
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 11 Accessing Database.
Copyright © 2001 by Wiley. All rights reserved. Chapter 9: Introduction to Working with Databases in Visual Basic Database Concepts Relational Database.
File Processing Concepts – Field – combination of 1 or more characters that is the smallest unit of data to be accessed – Record – group of related fields.
Lecture Note 10: Simple Database Techniques. Introduction –Database System –Access, SQL Server and others. –Microsoft Access - Interacting with this databases.
Visual Basic ADO Programming 56:150 Information System Design.
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
ActiveX Data Objects (ADO) is Microsoft’s latest database object model. The goal of ADO is to allow VB developers to use a standard set of objects to refer.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
Using Adapter Wizard ISYS 512. Data Adapter Wizard – 2 nd Level of Using ADO.Net Configure Data Adapter and generating a dataset: –From the Data tab of.
ADO.NET Objects – Data Providers Dr. Ron Eaglin. Requirements Visual Studio 2005 Microsoft SQL Server 2000 or 2005 –Adventure Works Database Installed.
Introduction to ADO.Net and VS Database Tools and Data Binding ISYS 350.
AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ODBC : Open Database Connectivity SNU OOPSLA Lab. October 2005.
1 ADO Activex Data Objects. 2 ADO ADO allows users to access data easily from many existing databases (such as Access or Paradox) From ODBC compliant.
DATABASE SYSTEM VB LINK TO MS-SQL. 2 Visual ProgrammingChapter 6 Select Project -> Component.
ADO & Recordsets. ADO Description & History  ActiveX Data Objects  History  1991 ODBC  Data Access Objects (DAO) for VB developers (JET)  Remote.
Lecture 4 Manipulating Form Data using methods of Recordset and RecordsetClone in VBA Restrict data with filter 1 Rapid Application Development.
 2 Data Object Library approaches ◦ DAO (Data Access Objects)  Original access strategy (up to VB6)  Closely linked to MS Access ◦ ADO (ActiveX Data.
ASP.NET Programming with C# and SQL Server First Edition
Accessing the Database Server: ODBC, OLE DB, and ADO
ActiveX Data Objects (ADO)
The Recordset Object.
INT213 Updating the Database.
5. Using databases in VB.
ADO.NET Accessing Databases in VS.NET
ربط الفيجوال بيسك VB مع قواعد البيانات
Brief description on how to navigate within this presentation (ppt)
VISUAL BASIC INTRODUCTION TO DATA CONNECTIVITY.
Chapter 10 ASP and Data Store Access
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Chapter 10 ADO.
Database Applications
Working With Databases
Chapter 10 Accessing Database Files
Unit – V Data Controls.
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Visual Basic Database Access BICS546

Microsoft Universal Data Access OLE DB: The OLE database protocol Allows a program to access information in any type of data source, and it is the basis for ADO. Data provider: databases, spreadsheets, etc. ADO: ActiveX Data Objects An Interface for OLE DB. Allow programmers to use a standard set of objects to refer to any OLE DB data source. ODBC: Open Database Connectivity A driver manager Used for relational databases

Program ActiveX Data Objects OLE DB Provider OLE DB Provider ODBC Data Source ODBC Data Source

Using ODBC Three types of data source names User DSN: usable only by you and only on the machine currently using. System DSN: Any one using the machine can use. File DSN: Can be copied and used by other computers with the same driver installed.

Visual Basic Database Tools Visual Data Manager Data Environments Data Views Data Report Designer Data Projects

Visual Data Manager Add-Ins/Visual Data Manager Supports: Access, dBase, FoxPro, Paradox, ODBC, Text files. Creating new database Managing existing database Query Builder, Form Wizard DAO

Data Environments Project/More ActiveX Designer/Data Environment Data Environments are designed to be the basis of design-time and run-time data access. They make data available to any forms and modules in your application.

Data Environments at Design Time Right Click Connection1 Click Properties to set up database connection Click Add Command to choose record source. Drag and drop fields from Command1 to form. Text box properties: Data Source: Data Environment1 Data Member: Command1 (Note: Data environment can support many command objects) Data Field

Data Environments at Run Time Access command object’s Recordset object and Recordset object’s methods. Recordset’s name: rs+command name. Ex. rsCommand1 Properties: EOF, BOF, RecordCount Methods: MoveFirst, MoveLast, MoveNext, MovePrevious

Data Environment Code Example DataEnvironment1.rsCommand1.MoveNext IF DataEnvironment1.rsCommand1.EOF THEN DataEnvironment1.rsCommand1.MoveLast END IF

Data Views View/Data View Window An overview of the database objects you have in a project, such as Data Environments, connections, data links.

Data Report Designer Project/Add Data Report Features of Data Report Designer Drag and Drop fields from the Data Environment to report detail section. The DataMember and DataField properties of the text box are automatically set. Drag and Drop the Command object (Must make sure the DataSOurce and DataMember properties of the DataReport are set properly).

Data Report Code Example ‘To preview report DataReport1.Show ‘To print DataReport.PrintReport

Data Projects VB projects come with built-in Data Environments and Data Report Designer.

Using Databases in VB Three VB database objects: DAO, RDO, ADO Two ways to work with these objects: VB Data controls, data-bound controls Programming objects

DAO Support the Jet database DAO data control Database property RecordSource property: tables, queries, SQL statement RecordSet Type Property: Table, Dynaset, Snapshot Able to connect to data sources such as dBase, text files, and Excel spreadsheet.

ADO Data Control Project/Components/Microsoft ADO 6.0 Double Click ADO to insert ADO Right Click and select ADODC Properties General : Source of Connection RecordSource: 1 – adCmdText: SQL statement 2 – adCmdTable: Table in the database 4 - adCmdStoredProc

ADO Properties BOF Action, EOF Action Command TimeOut: Amount of time in seconds the ADO control will allow for commands to be executed on the server. ConnectionString CursorLocation: server site, client site CursorType MaxRecords: 0 means no limit. RecordSource

Cursor Type Forward Only: Can only move forward through the recordset (can only MoveNext). Use the least amount of system resources. Static: Can navigate in both directions. Unable to see changes made by other users. Keyset: Can see changes made by other users (except insertions). Dynamic: Use most of resources, and can see all changes made by other users.

Cursor Lock Type ReadOnly Optimistic: Does not lock the file until updates are actually applied. BatchOptimistic: All changes be submitted at one time. Pessimistic: Lock the table the entire time that the recordset is open.

Cursor Mode Property Determines the access rights of the user. Read Write ReadWrite ShareDenyRead: Deny other from opening connections with read permissions. ShareDenyWrite ShareExclusive ShareDenyNone: Prevent others from opening conections with any permissions.