Academic Tutorials



English | French | Portugese | German | Italian
Google

Home Testimonials Advertise Contact Us About Us Link to Us
Source Codes E-Books Downloads Jobs Web Hosting Chats

Visual Basic Tutorial
Introduction to VB
Building a Visual Basic Application
Writing the Codes in VB
Working With Controls
Managing Visual Basic Data
Working With Variables
Controlling Program Flow
More on Program Control
Looping in VB
Introduction to VB Function
Creating VB Function For MS Excel
Arrays in VB
Working With Files
Creating Multimedia Applications in VB
Creating database applications in VB
Creating VB database applications using ADO control

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
CVS
Python
Apple Script
PL/SQL Tutorial
SQL Server
.NET (dotnet)
Microsoft.Net
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
VC++
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Matlab
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Graphics
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
SEO
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Eclipse
J2ME
JBOSS
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Cobol
Assembly Language
Mainframe
Forth Programming
Lisp Programming
Pascal
Delphi
Fortran
Oops
Data Ware Housing
CGI Programming
Emacs Tutorial
Gnome
ILU
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Oracle
MySQL
Operating System
BSD
Symbian
Unix
Internet
IP-Masquerading
IPC
MIDI
Software Testing
Testing
Firewalls
SAP Module
ERP
ABAP
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Netweaver
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft FrontPage
Microsoft InfoPath
Microsoft Access
Accounting
Financial Accounting
Managerial Accounting
Computer Basics
Basics of Computer


Creating VB database applications using ADO control
Previoushome


However, data control is not a very flexible tool because it could work only with limited kinds of data and must work strictly in the Visual Basic environment.We can use a much more powerful data control in VB known as ADO control to overcome these limitations. ADO stands for ActiveX data objects and as ADO is ActiveX-based, it could work in different platforms (different computer systems) and different programming languages. Besides, it could access many different kinds of data such as data displayed in the Internet browsers, email text and even graphics other than usual relational and non relational database information.

To be able to use ADO data control, you need to insert it into the toolbox and to do this, simply press Ctrl+T to open the components dialog box and select Microsoft ActiveX Data Control 6. After this only, you can proceed to build your ADO-based VB database applications.

The following example will illustrate how to build a relatively powerful database application using ADO data control and first of all, name the new form as frmBookTitle and change its caption to Book Tiles- ADO Application. Secondly, insert the ADO data control and name it as adoBooks and change its caption to book and next, insert the necessary labels, text boxes and command buttons. The runtime interface of this program is shown in the diagram below and it allows adding and deletion as well as updating and browsing of data.




Steps to build the database application using ADO
Step1:The properties of all the controls are listed as follow:
Form Name frmBookTitle
Form Caption Book Titles -ADOApplication
ADO Name adoBooks
Label1 Name lblApp
Label1 Caption Book Titles
Label 2 Name lblTitle
Label2 Caption Title :
Label3 Name lblYear
Label3 Caption Year Published:
Label4 Name lblISBN
Label4 Caption ISBN:
Labe5 Name lblPubID
Label5 Caption Publisher's ID:
Label6 Name lblSubject
Label6 Caption Subject :
TextBox1 Name txtitle
TextBox1 DataField Title
TextBox1 DataSource adoBooks
TextBox2 Name txtPub
TextBox2 DataField  Year Published
TextBox2 DataSource adoBooks
TextBox3 Name txtISBN
TextBox3 DataField ISBN
TextBox3 DataSource adoBooks
TextBox4 Name txtPubID
TextBox4 DataField  PubID
TextBox4 DataSource adoBooks
TextBox5 Name txtSubject
TextBox5 DataField  Subject
TextBox5 DataSource adoBooks
Command Button1 Name  cmdSave
Command Button1 Caption &Save
Command Button2 Name  cmdAdd
Command Button2 Caption &Add
Command Button3 Name  cmdDelete
Command Button3 Caption &Delete
Command Button4 Name  cmdCancel
Command Button4 Caption &Cancel
Command Button5 Name  cmdPrev
Command Button5 Caption &<
Command Button6 Name  cmdNext
Command Button6 Caption &>
Command Button7 Name  cmdExit
Command Button7 Caption E&xit



Step2:

To be able to manage and access a database, you need to connect the ADO data control to a database file. We are going to use BIBLIO.MDB that comes with VB6 and to connect ADO to this database file , follow the steps below:
a) Click on the ADO control on the form and then open up the properties window.
b) Click on the ConnectionString property, the following dialog box will appear.




step3:

when the dialog box appear, select the Use Connection String's Option and next, click build and at the Data Link dialog box, double-Click the option labeled Microsoft Jet 3.51 OLE DB provider.




Step4:

After that, click the Next button to select the file BIBLO.MDB and you can click on Text Connection to ensure proper connection of the database file. Click OK to finish the connection.

Finally, click on the RecordSource property and set the command type to adCmd Table and Table name to Titles and now you are really to use the database file.




Step5:

Now, you need to write code for all the command buttons and after which, you can make the ADO control invisible.




For the Save button, the program codes are as follow:

Private Sub cmdSave_Click()
adoBooks.Recordset.Fields("Title") = txtTitle.Text
adoBooks.Recordset.Fields("Year Published") = txtPub.Text
adoBooks.Recordset.Fields("ISBN") = txtISBN.Text
adoBooks.Recordset.Fields("PubID") = txtPubID.Text
adoBooks.Recordset.Fields("Subject") = txtSubject.Text
adoBooks.Recordset.Update

End Sub



For the Add button, the program codes are as follow:

Private Sub cmdAdd_Click()

adoBooks.Recordset.AddNew

End Sub



For the Delete button, the program codes are as follow:

Private Sub cmdDelete_Click()
Confirm = MsgBox("Are you sure you want to delete this record?", vbYesNo, "Deletion Confirmation")
If Confirm = vbYes Then
adoBooks.Recordset.Delete
MsgBox "Record Deleted!", , "Message"
Else
MsgBox "Record Not Deleted!", , "Message"
End If

End Sub



For the Cancel button, the program codes are as follow:

Private Sub cmdCancel_Click()

txtTitle.Text = ""
txtPub.Text = ""
txtPubID.Text = ""
txtISBN.Text = ""
txtSubject.Text = ""

End Sub



For the Previous (<) button, the program codes are

Private Sub cmdPrev_Click()

If Not adoBooks.Recordset.BOF Then
adoBooks.Recordset.MovePrevious
If adoBooks.Recordset.BOF Then
adoBooks.Recordset.MoveNext
End If
End If

End Sub



For the Next(>) button, the program codes are

Private Sub cmdNext_Click()

If Not adoBooks.Recordset.EOF Then
adoBooks.Recordset.MoveNext
If adoBooks.Recordset.EOF Then
adoBooks.Recordset.MovePrevious
End If
End If

End Sub

 Related Visual Basic Tutorial Books
A Visual Basic 6 Programmer's Toolkit
VB6 Reference Library
Practical Visual Basic 6
Learn VisualBasic
General Topics in VB
More Link » »
 
 Visual Basic Tutorial FAQs
Sorry No Records are Available
More Link » »
 
 Visual Basic Tutorial Interview Questions
what is visual basic?
What is MAPI?
What is early binding and late binding ?
WhatisOLEDB?
How many event in VB6 form.
More Link » »
 
 Visual Basic Tutorial Articles
Parsing and Sorting
Building Branching Structures
Implement Drag and Drop in Your Windows Forms Applications
What's New in Visual Basic 9.0
Visual Basic 2005 with .NET 3.0 Programmer's Reference
More Link » »
 
 Visual Basic Tutorial News
Publisher's description of Visual Basic 5.0 Runtime Module
Publisher's description of Visual Basic Database Projects
Exclusive Discount on uCertify’s 70-548 C# and VB Prepkits
More Link » »


Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • del.icio.us
  • De.lirio.us
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb

Previoushome

Keywords: Creating VB database applications using ADO, visual basic applications, how to database, visual basic database, ado ms access, ado asp net, visual basic ado, ado connection string, vb ms access, visual basic using, microsoft access ado, microsoft access database, ms access database, asp net database, ado sql server, ado visual basic 6, sql server database, vb source code, visual basic net applications, visual basic vb, using sql server, using source code


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
PL/SQL Quiz
SQL Server Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
VC++ Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
JBOSS Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
Oops Quiz
Data Ware Housing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizes
Oracle Quiz
MySQL Quiz
Operating System Quizes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
MIDI Quiz
Software Testing Quizes
Testing Quiz
Firewalls Quiz
SAP Module Quizes
ERP Quiz
ABAP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizes
Corba Quiz
Networking Quiz
Microsoft Office Quizes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft FrontPage Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizes
Financial Accounting Quiz
Managerial Accounting Quiz
Computer Basics Quizes
Basics of Computer Quiz
Copyright © 2008. Academic Tutorials.com. All rights reserved Privacy Policies | About Us
Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Quick2Host | Quick2Host Mirror | Quick Site Kit | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.