Visual Basic 2010 with MS-Access Database
Understanding ADO .Net for Visual Basic 2010 and Microsoft Access 2003 / 2007 Database
|Visual Basic .Net and Ado.Net for MS-Access Database course online|
Online mode or Connected mode or connected model
|ADO.Net Connected model, Ado.net connected mode|
Ado.Net Online-mode (Connected Mode) is just like the same old method we used to work with Databases from Visual Basic 6.0 and ADO2.8 version, all you need to do is :
- Create Access Database and a Table with your fields.
- Define the Database path
- Include ADO2.8 Reference into the Visual Basic 6.0 project
- Connect the Database
- Open the Database
- Operate your events (Save, Edit, Delete and find)
- Exit the VB6 Project and you will find the data in the Table were affected if events were processed correctly in the VB6 Project.
An example to the Online-mode with MS-Access 2003, is the Friends_Info. Basic code to connect to a MS-Access Database 2003/2007 from Visual Basic 2010 using the ADO.Net Online-Mode is :
|ADO.Net connected model example source code vb.net|
♦ Save Data into Table :
♦ Search for Data :
♦ Delete Data from Table :
Offline mode or Disconnected mode or disconnected model
|Ado.Net disconnected model|
ADO.Net Offline mode or the Disconnected method of working with Databases has a nice and easy logic :
You will see the difference now of using ADO technology only if you are familiar with classic ADO that we used to use in Visual Basic 6.0, but if you did not use it before that you won't.
♦ ADO.Net disconnected model works great with Client/Server applications
ADO.Net method is the preferred way to code client/server applications. The DataSet object is what the ADO.Net offline/Disconnected mode is all about, it gives you the ability to work on the Database components separately (it stores a Database copy in the Memory - RAM of the client machine while working on the Database components), so it gives you the ability to create multiple tables, fill them with data coming from different sources, enforce relationships between pairs of tables, and more.
♦ ADO.Net Offline mode is not recommended for ASP.Net
♦ Though the Dataset is a great choice to work with Client/Server applications, but when working for example with ASP.Net live pages, it is a bad choise because the ASP.Net pages don't live long before they finish their lifetime cycle.The above Friends Info VB.Net project using ADO.Net offline mode basic codes as follow :
◘ Connect to and Open Database :
◘ Save Data into Table :
◘ Search for Data :
◘ Delete Data :
Another topic about ADO.Net generally, is the ability to Create/Delete/Back-up Database, Add/Modify/Delete/Back-Up Tables and Queries using the OpenSchema method. Let's see how to do this in Visual Basic .Net 2010.I will discuss working with Crystal Reports for Visual Basic .Net in details in another post, starting Downloading SAP Crystal Reports until Packing SAP Crystal Reports and install it on the client's machine. Keep up !
→ VB2010 : To Create new Database using ADO.Net, you will need to add new reference to your project to AdoX (Microsoft ADO Ext. 2.x for Dll and Security) ...
|Create new Database in Visual Basic 2010|
→ VB2010 : To list all Database files from a Dir. into a TreeView control
→ VB2010 : To manage Tables using OpenSchema method
→ VB2010 : To manage Fields using OpenSchema method
Some Visual Basic Exceptions and Solutions Working with MS-Access 2003/2007
Exception: "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key Information"
Exception: "Syntax error (missing operator) in query expression ''He's')'.", while trying to Execute INSERT INTO Statement which carries String Values that contain Apostrophe like (He's)"
How to properly Close Connection to OleDB
♥ Here are some online Visual Basic lessons and courses :
- Visual Basic .Net snippets collection
- Visual Basic .Net - How to check for the internet connection
- Visual Basic .Net - POP3 and Receiving E-mails
- Visual Basic .Net - Generate Random Combinations
- Visual Basic .Net - Play sounds on Button Click or Mouse Hover
- Visual Basic .Net - Progressbar control
- Visual Basic .Net Solution - The application failed to initialize
- Visual Basic .Net - Working with Database full example
- Visual Basic .Net - There is already an open DataReader associated
- Visual Basic .Net - SyBase Advantage Database [Add, Edit, Search, Delete and DataGridView]
- Visual Basic .Net - Math Functions
- Visual Basic .Net - Communicating with clients [Requirements Docs, Use-Case]
- Visual Basic .Net - Command Prompt Read/Write
- Visual Basic .Net - Free POS System Project Source Code