Saving and Accessing Data

Slides:



Advertisements
Similar presentations
CSM18 FilesDr Terry Hinton1 VB - Persistence in software Information entered into a program is volatile Can switch computer off Power can be removed accidentally.
Advertisements

MS-Access XP Lesson 1. Introduction to MS-Access Database Management System Software (DBMS) Store data in databases Database is a collection of table.
Operating System Type of Operating System
File Management in C. A file is a collection of related data that a computers treats as a single unit. File is a collection of data stored permanently.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. Unix system calls (part 2)
FILE TRANSFER PROTOCOL Short for File Transfer Protocol, the protocol for exchanging files over the Internet. FTP works in the same way as HTTP for transferring.
File Access, Dialog Boxes, Error Handling, and Menus Chapter 5.
Component 9, Slide 1 CP2030 Copyright © University of Wolverhampton CP2030 Visual Basic for C++ Programmers v Component 9 working with text files and random.
Chapter 9: Sequential Access Files and Printing
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 9 Structures and Sequential Access Files.
CHAPTER 6 FILE PROCESSING. 2 Introduction  The most convenient way to process involving large data sets is to store them into a file for later processing.
WORKING WITH FILES, MENUS AND DATABASES IN VISUAL BASIC BY V. V. SUBRAHMANYAM.
Pasewark & Pasewark 1 Access Lesson 6 Integrating Access Microsoft Office 2007: Introductory.
Chapter 5 Basics of File Input and Output Reading, Writing, and Printing Text Files 5 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall,
UNESCO ICTLIP Module 4. Lesson 4 Database Design, and Information Storage and Retrieval Lesson 4. Advanced features of WinISIS.
Programming Logic and Design Seventh Edition
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
Exploring Office Grauer and Barber 1 Introduction to Access: What is a Database?(Wk1)
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
Chapter 10: File-System Interface 10.1 Silberschatz, Galvin and Gagne ©2011 Operating System Concepts – 8 th Edition 2014.
Data files and databases. Need a control to browse to a file Standard controls for drive folder and list not much use The CommonDialogs control offers.
File Handling and Control Break Logic. Objectives In this chapter, you will learn about: Computer files Writing a program that reads from and/or writes.
Introduction to Programming Using C Files. 2 Contents Files Working with files Sequential files Records.
CCS – Mail Merge Mail Merge This presentation is incomplete without the associated discussion 1 Coloma Community Schools In-service 21 March 2014.
© 1999, by Que Education and Training, Chapter 9, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
Sequential files School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 12, Monday 4/07/2003)
Using Text Files in Excel File I/O Methods. Working With Text Files A file can be accessed in any of three ways: –Sequential access: By far the most common.
Files Tutor: You will need ….
Pay Example (PFirst98) Please use speaker notes for additional information!
Introduction to Files in VB Chapter 9.1, 9.3. Overview u Data Files  random access  sequential u Working with sequential files  open, read, write,
BACS 287 File-Based Programming. BACS 287 Data Hierarchy  Database - Collection of files, relationships, integrity information, etc  Files - All records.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
Tutorial 81 Field, Record, Data File Field - a single item of information about a person, place, or thing Record - a group of related fields that contain.
FTP Client API FTP in embedded devices Implementing an FTP Client FTP Command APIs Other FTP Client APIs.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 9 Structures and Sequential Access Files.
Comp 335 File Structures Fundamental File Structure Concepts.
ECE 456 Computer Architecture Lecture #9 – Input/Output Instructor: Dr. Honggang Wang Fall 2013.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the differences between text and binary files ❏ To write programs.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Chapter 9: Data types and data structures OCR Computing for A Level © Hodder Education 2009.
1 Displaying Dialog Boxes Kashef Mughal. 2 Midterm Stats Here we go  Average was  Low was 116  High was 184  Mid Quarter Grade - check any.
Introduction Every program takes some data as input and generate processed data as out put . It is important to know how to provide the input data and.
Multiple Forms and Menus
Chapter 14: Sequential Access Files
Microsoft Visual Basic 2005: Reloaded Second Edition
The Data Types and Data Structures
06 File Objects and Directory Handling
Chapter 7 Text Input/Output Objectives
BASIC INFORMATION ABOUT DATABASE MANAGEMENT SOFTWARE
Chapter 7 Text Input/Output Objectives
Operating Systems (CS 340 D)
Logan-Hocking Schools
5. Using databases in VB.
Chapter 13: File Input and Output
Methods of accessing a File
Binary Files.
Topics Introduction to File Input and Output
Chapter 7 Files and Exceptions
IS-171 Computing With Spreadsheets
Microsoft Excel 2007 – Level 2
Visual Basic 6 Programming.
Text / Serial / Sequential Files
Files Management – The interfacing
Random Access Files / Direct Access Files
Functions continued.
Topics Introduction to File Input and Output
BO65: PROGRAMMING WRITING TO TEXT FILES.
Grauer and Barber Series Microsoft Access Chapter One
Topics Introduction to File Input and Output
Text / Serial / Sequential Files
Presentation transcript:

Saving and Accessing Data

Two general ways to save data To an established file format, like MS Access or Excel. That is the most common way. To a file that you define (dat, txt, etc.): Sequential Random Binary

File differences Sequential Read/Write the WHOLE file Random Read/Write any Record Binary Read/Write any Byte

Opening Files Read Write Both Open “theFile.txt” as #1 Now refer to theFile.txt as #1 The # is the “channel” of the file You can find a FreeFile.

You open with the following modes: Append Binary Output Random Adds to end of sequential file Write/Read individual Bytes Write/Overright sequential file Write to specific Records Random is the Default Open “myFile.txt” for Random as #3

Managing Multiple Users Access Restriction Write Read Write Read LockType Shared Lock Read Lock Write Lock Read Write Open "C:\Random.txt" For Random Access Read Write Shared As #intFile Len = 5 Book is not clear on Access. These are needed when multiple users are involved to maintain file integrity.

Length -- Len Necessary with random files to let the computer know how far to look for the next record. RECORD – One “line” or set of information. Examples: Each recipe in a cookbook; Each entry in an address book.

Input/Output Choices To File From File Sequential (Append, Input, Output) Print # Write # Read # Random Put # Get # Put #7, recordNum, Variable

Delimeters Delimeters are characters that indicate the end of a “column” or “field” A column or field is one variable in a record. Kevin, Harville, Instructor, 123-45-6789 Joe, Jones, Dog Catcher, 987-65-4321

Record Lengths Kevin Harville Instructor Joe Jones Dog Catcher Establishing data lengths helps the computer know where to look for the information

Data Types Data Types are like a master variable with sub-variables. Employee.Age Employee.FirstName Employee.LastName Employee.SSN

Data Types Declare in Modules Type Employee strFName As String * 10 strLName As String * 16 strSSN As String * 12 End Type ----------------------------------- Dim Worker(100) As Employee Worker(x).strFName=strInputName Worker(x).strLName=strInputLName Worker(x).strSSN=txtSSN.Text

File Controls File List Box Drive List Box Directory List Box You need to program functionality in these or the common dialog box to manually access files

File Commands Chdrive ChDir Kill MkDir RmDir Dir

Changing Usual place to responde to changes is in the Change event of the directory, file, or drive controls. ChDrive drvDisk.Drive ChDir dirDirect.Path FilFiles.Pattern= “*.txt; *.htm”