ADO and DataList, DataCombo and DataGrid Controls Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
Basics of Database Programming with VB6
Advertisements

McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 12 Advanced Data Handling.
Internal connection and introduction to shape language Please use speaker notes for additional information.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Mark Dixon, SoCCE SOFT 131Page 1 16 – Persistent data storage: relational databases and ADO.
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 ADO Programmatically The Connection Object, Command Object, and Recordset Object.
ActiveX Data Control BICS 546. Intrinsic and ActiveX Controls VB supports two types of controls: –Intrinsic controls (command button, listbox, etc): When.
Programming the RecordSet Object
Using ADO Programmatically The Connection Object and the Command Object.
More on lists, exceptions, loops and validation. You can use the exception to indicate the error that occurred Private Sub btnCheck_Click(ByVal sender.
Muffin Shop - if, calculations etc. (muffins, muffins2) Please use speaker notes for additional information!
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Introduction to ADO By David R. Stevenson Consulting Software Engineer ABB Automation.
VBA Form Techniques. Open a form from another form Private Sub cmdSupplierForm_Click() DoCmd.OpenForm "frmSupplierDetails" End Sub Code in Standard module.
Break Processing Please use speaker notes for additional information!
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 11 Accessing Database.
Chapter 7 Code Tables. VB Code Box 7-1 Event Procedure for Compute Button Private Sub hsbExemptions_Change() txtExemptions.Text =Str(hsbExemptions.Value)
Relational databases and third normal form As always click on speaker notes under view when executing to get more information!
Microsoft Access Using Visual Basic Routines. Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink.
Programming Examples to Accompany Structure Topic Please use speaker notes for additional information!
More on relational databases, including 1 to 1, 1 to many and many to many relationships Please use speaker notes for additional information!
Relationships and Advanced Query Concepts Using Multiple Tables Please use speaker notes for additional information!
Faculty of Electronic Engineering 1 Database Access API’s Aleksandar Stanimirović Leonid Stoimenov Aleksandar Milosavljević.
Array - adding to array at run time Please see speaker notes for additional information!
Visual Basic ADO Programming 56:150 Information System Design.
Visual Basic CODE. Basics of Code Declaration Declaration Set aside a named place to put things Set aside a named place to put things Assignment Assignment.
MDI with Menu Please use speaker notes for additional information!
Random Files Please see speaker notes for additional information!
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.
MIS 216 Exam1 Review Spring What to expect Questions like those on the home works and on the quizzes Evaluate code Create code Multiple choice and.
Delivery and other DO Examples Please use speaker notes for additional information!
Notes on ADO from other projects Please use speaker notes for additional information!
Two Forms Please use speaker notes for additional information!
ASP.NET Binding and an Introduction to Database Queries Please use speaker notes for additional information!
AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.
Tutorial 101 Variable Arrays A group of variables that have the same name and data type and are related in some way Can have as many as 60 dimensions.
Pay Example (PFirst98) Please use speaker notes for additional information!
Lab 8 Data Access Using Microsoft ActiveX Data Object (ADO)
Visual Basic I/O Programs (ProjRead1, ProjRead2, ProjWrite1, ProjPay) Please use speaker notes for additional information!
Created by Alia Al-Abdulkarim 2008 Visual Basic Vs. Java.
Maximum Profit Please use speaker notes for additional information!
Scrollbar1 The Scrollbar A final tool in the toolbox is the scrollbar. There are two of them, one ordered horizontally and the other vertically, both do.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
The Windows Forms DataGrid A Complex-Bound.NET GUI Control Mike FITZSIMON SYSTEMSARCHITECT F ITZSIMON IT C ONSULTING PTY LTD.
Using a Database Access97 Please use speaker notes for additional information!
PHP with MYSQL Please use speaker notes for additional information!
DATABASE SYSTEM VB LINK TO MS-SQL. 2 Visual ProgrammingChapter 6 Select Project -> Component.
Two-Dimensional Arrays. Two-dimensional arrays variables store the contents of tables or matrices. Example: Dim arrTable(1 to 5, 1 to 5) As Integer first.
Ch. 101 DataTable (Continue) Lab sheet 10.3: Form Display Cities table along with percentage growth.
Data Control In this presentation… –databases supported –inserting a data control –data control properties –using the data control.
 2 Data Object Library approaches ◦ DAO (Data Access Objects)  Original access strategy (up to VB6)  Closely linked to MS Access ◦ ADO (ActiveX Data.
Visual Basic - Break Processing
Processing multiple files
Find, filter etc with connection to Access code internally
The Recordset Object.
Introduction to VB programming
MICROSOFT VISUAL BASIC
Please see speaker notes for additional information!
ربط الفيجوال بيسك VB مع قواعد البيانات
للمزيد زورونا على موقعنا الإلكتروني:
Please use speaker notes for additional information!
Department Array in Visual Basic
البرمجة بلغة فيجول بيسك ستوديو
المستخدمين والصلاحيات فى برنامجك
Report using ADO connection
Classes and Objects VB.net.
Excel – VBA TypeMismatch (Error 13) on OpenRecordset Method Call
Excel Import data from Access to Excel (ADO) using VBA
Please see speaker notes for additional information!
Presentation transcript:

ADO and DataList, DataCombo and DataGrid Controls Please use speaker notes for additional information!

ADO & DataListControls Adodc DataList DataCombo Projects/Components and select the following.

Private Sub Form_Load() Dim strConnectStr As String Dim databasepath As String databasepath = App.Path If Right(databasepath, 1) <> "\" Then databasepath = databasepath & "\" End If databasepath = databasepath & "donor.mdb" strConnectStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" strConnectStr = strConnectStr & databasepath ADODonations.ConnectionString = strConnectStr ADODonations.CommandType = adCmdTable ADODonations.RecordSource = "Donation2000" ADODonations.Refresh ADODrive.ConnectionString = strConnectStr ADODrive.CommandType = adCmdTable ADODrive.RecordSource = "Drive2000" ADODrive.Refresh ADODonor.ConnectionString = strConnectStr ADODonor.CommandType = adCmdTable ADODonor.RecordSource = "Donor2000" ADODonor.Refresh Set dlcName.DataSource = ADODonations dlcName.BoundColumn = "DIdno" dlcName.DataField = "DIdno" Set dbcName.DataSource = ADODonations dbcName.BoundColumn = "DIdno" dbcName.DataField = "DIdno" Set dbcDrive.DataSource = ADODrive dbcDrive.BoundColumn = "DDriveNo" dbcDrive.DataField = "DDriveNo" End Sub

ADO and DataGrid Controls

Private Sub Form_Load() Dim strConnectStr As String databasepath = App.Path If Right(databasepath, 1) <> "\" Then databasepath = databasepath & "\" End If databasepath = databasepath & "donor.mdb" strConnectStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" strConnectStr = strConnectStr & databasepath ADODonor.ConnectionString = strConnectStr ADODonor.CommandType = adCmdTable ADODonor.RecordSource = "Donor2000" ADODonor.Refresh End Sub Connecting the ADO to the data This shows the code to connect ADODonor to the correct table in the correct database.

ADO and DataGrid

Private Sub Form_Load() Dim strConnectStr As String databasepath = App.Path If Right(databasepath, 1) <> "\" Then databasepath = databasepath & "\" End If databasepath = databasepath & "donor.mdb" strConnectStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" strConnectStr = strConnectStr & databasepath ADODonor.ConnectionString = strConnectStr ADODonor.CommandType = adCmdTable ADODonor.RecordSource = "Donor2000" ADODonor.Refresh Set dgdDonor.DataSource = ADODonor End Sub ADO and DataGrid

Private Sub Form_Load() Dim strConnectStr As String databasepath = App.Path If Right(databasepath, 1) <> "\" Then databasepath = databasepath & "\" End If databasepath = databasepath & "donor.mdb" strConnectStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" strConnectStr = strConnectStr & databasepath ADODonor.ConnectionString = strConnectStr ADODonor.CommandType = adCmdTable ADODonor.RecordSource = "Donor2000" ADODonor.Refresh Set dgdDonor.DataSource = ADODonor dgdDonor.Columns(0).Caption = "ID #" dgdDonor.Columns(1).Caption = "Name" dgdDonor.Columns(2).Visible = False dgdDonor.Columns(3).Caption = "City" dgdDonor.Columns(4).Caption = "State" dgdDonor.Columns(4).Width = 750 dgdDonor.Columns(5).Visible = False dgdDonor.Columns(6).Caption = "Year 1st" dgdDonor.Columns(6).Width = 1200 dgdDonor.Columns(7).Caption = "Contact" End Sub ADO code

ADO Grid code

PrDonorCustom.vbp Private Sub WhichRecord() Dim wkCt As Integer Dim wkCurr As Integer wkCt = ADODonor.Recordset.RecordCount wkCurr = ADODonor.Recordset.AbsolutePosition 'Note that to have EOF work correctly you need to 'set the EOFAction in the properties to 1-adStayEOF If ADODonor.Recordset.EOF Then ADODonor.Caption = "EOF" Else ADODonor.Caption = "Record " & wkCurr & "/" & wkCt End If End Sub Private Sub ADODonor_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset) Call WhichRecord End Sub

PrDonorCustom.vbp