SlideShare a Scribd company logo
Database Connectivity
    using ADODB
Visual Basic 6 ADO
 Visual Basic 6 obsoletes the previously used
  database access technology provided by Jet
 This provides a new one known as ADO or Active
  Data Objects
 This technology allows users to access data
  easily from many existing databases like Oracle
  or MS SQL Server
 ADO is quite simple and allows programmers to
  provide flexible database front ends
Connection Object
 This object represents an open connection to the
  data source
 This connection can be a local connection or can
  be across a network
 Key Properties and Methods
          Property            Methods
   ConnectionString     Close
   Provider             Open
   ConnectionTimeout
   CommandTimeout
   CursorLocation
   Mode
Command Object
 A command object specifies a specific method
  you intend to execute on or against the data
  source accessed by an open connection
 Key Properties and Methods


           Property               Methods
   Key Properties and   Execute
   Methods
   CommandText
   CommandType
Recordset Object
 The RecordSet object represents a complete set
  of records from an underlying base table in the
  database
 RecordSet object references only one record at a
  time as the current record
 Key Properties and Methods Methods
              Property
       CursorLocation     AddNew
       CursorType         Close and Open
       EOF and BOF        MoveNext
       Fields             MoveFirst
       RecordCount        MoveLast
                          MovePrevious
Putting These altogether
 Define and open a Connection to a data source
 Decide what data you need from the data source
  and define Command objects that will retrieve this
  data.
 Retrieve the data you require by executing the
  command objects and manipulate the data using
  RecordSet objects.
Database Connectivity
          Steps
 Make a VB application that can be used to
 connect to database
 Go to components
 Choose Microsoft ADO Data Control 6.0(OLEDB)
 Component is added
 Click on Adodc and go to its properties
 Click on Build
 Select Microsoft Jet 4.0 OLE DB Provider and
 next
 Select database and test the connection
 From here copy connection string and click ok
Establish Connection
Dim con As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim cmd As New ADODB.Command
Private Sub Form_Load()
con.ConnectionString
  ="Provider=Microsoft.Jet.OLEDB.4.0;Data
  Source=C:Documents and
  SettingsAdministratorDesktopEmployee.mdb"
con.Open
rs.Open "select * from employee", con,
  adOpenDynamic, adLockOptimistic
cmd.ActiveConnection = con
Conti..
txt_id = rs.Fields(0)
txt_name = rs.Fields(1)
txt_desig = rs.Fields(2)
txt_add = rs.Fields(3)
txt_sal = rs.Fields(4)
txt_doj = rs.Fields(5)
txt_phn = rs.Fields(6)
txt_email = rs.Fields(7)
How to use Flex Grid in
           VB
 Go to components
 Choose Microsoft FlexGrid Control 6.0 from
 components
 Select flexgrid from toolbox and drop it in form
 Select Data tool from tool box and drop it in form
 Select DataSource property of FlexGrid
 Choose DatabaseName from Data tool properties
 Choose your database which you want to use
 Choose Recordset property of Data tool
 Your selected recordset will be shown in flexgrid
How to use data grid in
           VB
 Go to components
 Select Microsoft DataGrid Control 6.0(OLEDB)
 Select data grid from tool box and drop in form
 Go to Adodc properties
 Select Microsoft Jet 4.0 ILE Db Provider
 Select database name
 Test the connection
 Go to RecordSource select CommandType as 2-
 adCmdTable and Table
 Select DataSource from data grid properties
 Your data grid is working
References
 http://www.w3schools.com
 http://www.codeproject.com
 http://msdn.microsoft.com

More Related Content

What's hot (20)

PPT
Introduction to method overloading & method overriding in java hdm
Harshal Misalkar
 
PPT
Files in c++ ppt
Kumar
 
PPTX
Introduction to database & sql
zahid6
 
PPTX
5. stored procedure and functions
Amrit Kaur
 
PDF
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Biplap Bhattarai
 
PPTX
python conditional statement.pptx
Dolchandra
 
PPTX
Transaction states and properties
Chetan Mahawar
 
PPT
Hash table
Rajendran
 
PPTX
Java exception handling
BHUVIJAYAVELU
 
PPT
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Oum Saokosal
 
PPT
Transport Layer
Amin Omi
 
PPTX
joins in database
Sultan Arshad
 
PPTX
Normalization
Salman Memon
 
PPTX
Doubly Linked List || Operations || Algorithms
Shubham Sharma
 
PPTX
SQL Joins.pptx
Ankit Rai
 
PPTX
SQL - DML and DDL Commands
Shrija Madhu
 
PPTX
Windowforms controls c#
prabhu rajendran
 
PPTX
Constructor in java
Pavith Gunasekara
 
PPT
Database Connection
John Joseph San Juan
 
Introduction to method overloading & method overriding in java hdm
Harshal Misalkar
 
Files in c++ ppt
Kumar
 
Introduction to database & sql
zahid6
 
5. stored procedure and functions
Amrit Kaur
 
Normalization | (1NF) |(2NF) (3NF)|BCNF| 4NF |5NF
Biplap Bhattarai
 
python conditional statement.pptx
Dolchandra
 
Transaction states and properties
Chetan Mahawar
 
Hash table
Rajendran
 
Java exception handling
BHUVIJAYAVELU
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Oum Saokosal
 
Transport Layer
Amin Omi
 
joins in database
Sultan Arshad
 
Normalization
Salman Memon
 
Doubly Linked List || Operations || Algorithms
Shubham Sharma
 
SQL Joins.pptx
Ankit Rai
 
SQL - DML and DDL Commands
Shrija Madhu
 
Windowforms controls c#
prabhu rajendran
 
Constructor in java
Pavith Gunasekara
 
Database Connection
John Joseph San Juan
 

Viewers also liked (20)

PPT
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
Muralidharan Radhakrishnan
 
PPT
ADO CONTROLS - Database usage
Muralidharan Radhakrishnan
 
PPT
VB6 Using ADO Data Control
Notre Dame of Midsayap College
 
PPTX
Web based database application design using vb.net and sql server
Ammara Arooj
 
PPT
Database programming in vb net
Zishan yousaf
 
PPTX
Presentation on visual basic 6 (vb6)
pbarasia
 
PPT
Visual basic ppt for tutorials computer
simran153
 
PDF
Chapter 10 Future Directions In Erp A Lexis Leon
Sonali Chauhan
 
PPT
Erp Alex Leon Chapter 10
Sonali Chauhan
 
PPT
MS Access and Database Fundamentals
Ananda Gupta
 
PPT
Future directions in erp
Adhithyathangavelu
 
PDF
Chapter 10 Future Directions In ERP
Sonali Chauhan
 
PPTX
Top five future trends in erp
حمد الشلوي
 
PPT
Introduction to visual basic programming
Roger Argarin
 
DOC
project on visual basic 6.0 ' Jewellery Shop Management'
Anitha Krishnappa
 
PPT
Future Of Erp
Abhinav Goyal
 
PPTX
Basic controls of Visual Basic 6.0
Salim M
 
DOCX
Visual basic
Dharmik
 
PPTX
Introduction to Project Development using Visual Basic
Muralidharan Radhakrishnan
 
PPTX
Introduction to automated visual testing
adamcarmi
 
ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book
Muralidharan Radhakrishnan
 
ADO CONTROLS - Database usage
Muralidharan Radhakrishnan
 
VB6 Using ADO Data Control
Notre Dame of Midsayap College
 
Web based database application design using vb.net and sql server
Ammara Arooj
 
Database programming in vb net
Zishan yousaf
 
Presentation on visual basic 6 (vb6)
pbarasia
 
Visual basic ppt for tutorials computer
simran153
 
Chapter 10 Future Directions In Erp A Lexis Leon
Sonali Chauhan
 
Erp Alex Leon Chapter 10
Sonali Chauhan
 
MS Access and Database Fundamentals
Ananda Gupta
 
Future directions in erp
Adhithyathangavelu
 
Chapter 10 Future Directions In ERP
Sonali Chauhan
 
Top five future trends in erp
حمد الشلوي
 
Introduction to visual basic programming
Roger Argarin
 
project on visual basic 6.0 ' Jewellery Shop Management'
Anitha Krishnappa
 
Future Of Erp
Abhinav Goyal
 
Basic controls of Visual Basic 6.0
Salim M
 
Visual basic
Dharmik
 
Introduction to Project Development using Visual Basic
Muralidharan Radhakrishnan
 
Introduction to automated visual testing
adamcarmi
 
Ad

Similar to Data base connectivity and flex grid in vb (20)

PPTX
Ado object
RajaRajeswari22
 
PDF
Oracle to vb 6.0 connectivity
rohit vishwakarma
 
PPT
vishual basic data base Pankaj
Rai Saheb Bhanwar Singh College Nasrullaganj
 
PPT
Marmagna desai
jmsthakur
 
PPS
VISUAL BASIC .net data accesss vii
argusacademy
 
PDF
Ado.Net
LiquidHub
 
PPTX
ADO.NET -database connection
Anekwong Yoddumnern
 
PPT
Ado
abhay singh
 
PPTX
Is2215 lecture7 lecturer_ado_intro
dannygriff1
 
PPT
Asp #2
Joni
 
PDF
smiley018.pdf visual basic program in university notes download online book m...
ashokkim28
 
PPTX
Databases
John Joseph San Juan
 
PPTX
Ado.net
pacatarpit
 
PPSX
ADO.NET
Farzad Wadia
 
PPTX
1 introduction
Ngeam Soly
 
PPTX
Ado .net
Manish Singh
 
PDF
Unit4
Abha Damani
 
DOCX
Simple ado program by visual studio
Aravindharamanan S
 
DOCX
Simple ado program by visual studio
Aravindharamanan S
 
PDF
Bt0082 visual basic2
Techglyphs
 
Ado object
RajaRajeswari22
 
Oracle to vb 6.0 connectivity
rohit vishwakarma
 
vishual basic data base Pankaj
Rai Saheb Bhanwar Singh College Nasrullaganj
 
Marmagna desai
jmsthakur
 
VISUAL BASIC .net data accesss vii
argusacademy
 
Ado.Net
LiquidHub
 
ADO.NET -database connection
Anekwong Yoddumnern
 
Is2215 lecture7 lecturer_ado_intro
dannygriff1
 
Asp #2
Joni
 
smiley018.pdf visual basic program in university notes download online book m...
ashokkim28
 
Ado.net
pacatarpit
 
ADO.NET
Farzad Wadia
 
1 introduction
Ngeam Soly
 
Ado .net
Manish Singh
 
Simple ado program by visual studio
Aravindharamanan S
 
Simple ado program by visual studio
Aravindharamanan S
 
Bt0082 visual basic2
Techglyphs
 
Ad

More from Amandeep Kaur (20)

PPTX
Video/ Graphics cards
Amandeep Kaur
 
DOCX
Menu vb
Amandeep Kaur
 
PPTX
Menu pop up menu mdi form and playing audio in vb
Amandeep Kaur
 
PPT
Active x control
Amandeep Kaur
 
PPTX
Image contro, and format functions in vb
Amandeep Kaur
 
PPTX
Toolbar, statusbar, coolbar in vb
Amandeep Kaur
 
PPTX
Richtextbox
Amandeep Kaur
 
PPTX
Treeview listview
Amandeep Kaur
 
PPTX
Progress bar
Amandeep Kaur
 
PPTX
Filehandling
Amandeep Kaur
 
DOC
Socket
Amandeep Kaur
 
PPT
Ppt of socket
Amandeep Kaur
 
PPT
Introduction to computer graphics
Amandeep Kaur
 
PPT
Introduction to computer graphics
Amandeep Kaur
 
PPT
Introduction to computer graphics
Amandeep Kaur
 
PPT
Internet
Amandeep Kaur
 
DOCX
Internet working
Amandeep Kaur
 
DOC
Report on browser war
Amandeep Kaur
 
DOC
Report of internet connections
Amandeep Kaur
 
DOCX
Report on intranet
Amandeep Kaur
 
Video/ Graphics cards
Amandeep Kaur
 
Menu vb
Amandeep Kaur
 
Menu pop up menu mdi form and playing audio in vb
Amandeep Kaur
 
Active x control
Amandeep Kaur
 
Image contro, and format functions in vb
Amandeep Kaur
 
Toolbar, statusbar, coolbar in vb
Amandeep Kaur
 
Richtextbox
Amandeep Kaur
 
Treeview listview
Amandeep Kaur
 
Progress bar
Amandeep Kaur
 
Filehandling
Amandeep Kaur
 
Ppt of socket
Amandeep Kaur
 
Introduction to computer graphics
Amandeep Kaur
 
Introduction to computer graphics
Amandeep Kaur
 
Introduction to computer graphics
Amandeep Kaur
 
Internet
Amandeep Kaur
 
Internet working
Amandeep Kaur
 
Report on browser war
Amandeep Kaur
 
Report of internet connections
Amandeep Kaur
 
Report on intranet
Amandeep Kaur
 

Recently uploaded (20)

PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPT
Indian Contract Act 1872, Business Law #MBA #BBA #BCOM
priyasinghy107
 
PPTX
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
Light Reflection and Refraction- Activities - Class X Science
SONU ACADEMY
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PPTX
ENG8_Q1_WEEK2_LESSON1. Presentation pptx
marawehsvinetshe
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PPTX
SD_GMRC5_Session 6AB_Dulog Pedagohikal at Pagtataya (1).pptx
NickeyArguelles
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
Horarios de distribución de agua en julio
pegazohn1978
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Indian Contract Act 1872, Business Law #MBA #BBA #BCOM
priyasinghy107
 
Introduction to Biochemistry & Cellular Foundations.pptx
marvinnbustamante1
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Light Reflection and Refraction- Activities - Class X Science
SONU ACADEMY
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
WATERSHED MANAGEMENT CASE STUDIES - ULUGURU MOUNTAINS AND ARVARI RIVERpdf
Ar.Asna
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
epi editorial commitee meeting presentation
MIPLM
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
ENG8_Q1_WEEK2_LESSON1. Presentation pptx
marawehsvinetshe
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
SD_GMRC5_Session 6AB_Dulog Pedagohikal at Pagtataya (1).pptx
NickeyArguelles
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 

Data base connectivity and flex grid in vb