Search VB 2010

Thursday, November 25, 2010

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
There are two methods to work with MS-Access 2003/2007 Database (*.Mdb / *.Accdb) from Visual Basic 2010 using ADO .Net technology .
With .NET, Microsoft has released a new mechanism for accessing data: ADO.NET. The name is a carryover from Microsoft's ADO (ActiveX Data Objects) technology, but it no longer stands for ActiveX Data Objects--it's just ADO.NET. To avoid confusion, I will refer to ADO.NET as ADO.NET and to ADO as classic ADO.
If you're familiar with classic ADO, be careful--ADO.NET is not a descendant, it's a new technology. In order to support the Internet evolution, ADO.NET is highly focused on disconnected data and on the ability for anything to be a source of data. While you will find many concepts in ADO.NET to be similar to concepts in classic ADO, it is not the same.

Method (1) Online mode
Online-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.
 And the this is the same logic with ADO.Net in Visual Basic 2010 and MS-Access 2003/2007. The difference is in coding interface, but also the logic is the same some how, more than VB6 Coding, but more understandable.

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 :
Visual Basic Online Courses

♦ Connect to and Open Database :

♦ Save Data into Table :

♦ Search for Data :

♦ Delete Data from Table :

Method (2) Offline mode
ADO.Net Offline Mode

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 Offline mode or the Disconnected method of working with Databases has a nice and easy logic :
♦ ADO.Net Offline mode 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 :

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 !
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.

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) ...
VS2010, ADOX, ADO.Net, MS-Access
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"
Solution  :

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)"
Solution :

Here are some online Visual Basic lessons and courses :


  1. There's certainly a lot to know about this issue.

    I really like all of the points you have made.

    Feel free to surf to my web-site; Read ()

  2. For instance, women can experience hair loss, according to Real
    Age, no real support for the theory of detoxification exists.
    The natural hair loss treatment products do work
    for some people, but I use hats more as a prop to coordinate my hair rather than for the looks.
    Women with extensive hair loss had higher rates of
    hair loss treatment viviscal Type 2 diabetes and bacterial
    scalp infections than those with mild or no hair loss.

    Feel free to surf to my site; what causes hair loss in women

  3. I think this is onе of the most vitɑl informɑtion for me.
    And i am glad readinǥ your article. But wаnna remark on few general things, The website stʏle is perfect, tҺe
    artiсles is really greɑt : D. Good јob, cheers

    Here is my web-site; Google

  4. Αt this time it sounds like Movable Type is the top blogginǥ platform out there right
    now. (from whɑt I've read) Is that what
    you're using on your blog?

    My webpage; Google

  5. I quite like гeaɗing aո article that will makе
    men and women think. Also, thanks for allowing for me tо comment!

    Here is mу site :: google

  6. No matter if some one searches for his essential thiոg,
    so he/she needs to be available that in detail, therefore that thing іs maintained over here.

    My web site :: Google

  7. Wonderful blog! I found it while surfing around on Yahoo News.

    Do you have any suggestions on how to get listed in Yahoo News?
    I've been trying for a while but I never seem to get there!


    Feel free to visit my blog; internet

  8. Do you have a spam issue on this blog; I also am a blogger, and I was wanting
    to know your situation; we have created some nice methods and we
    are looking to exchange strategies with others, why not shoot me an e-mail if interested.

    Here is my homepage Kalkulator

  9. That means the theme will adjust itself to the screen size of various devices used to browse the web.
    Did you just write a piece giving your opinion on politics.
    Landing Page Riches for Wordpress plugin, makes it virtually "dummy proof" when it comes to installation.

    Here is my web blog; κατασκευη ιστοσελιδων

  10. Because your boyfriend or girlfriend went in one relationship straight to an alternative, she never had the time to have over you.

    What, exactly, will be exaggerated: length, girth or both.
    Students are extremely busy making up their own decisions and
    teacher tends becoming a sort of guide on their side.

    Here is my homepage; &20154;&27671;オンラインゲーム

  11. having a disclaimer statement regarding which browser or screen resolution they designed their website, for optimum viewing.
    It was just when I subscibed to a online reverse phone search service that I found
    the individual I was seeking. Fashion models depend on the slim figures because of their
    livelihood, so it is imperative they always look great.

    My website ... casino legal en ligne

  12. You ought to be a part of a contest for one of the highest quality websites on the web.
    I'm going to highly recommend this blog!

    Also visit my web site; buy garcinia cambogia

  13. Nice response in return of this question with solid arguments and telling everything concerning that.

    my web-site :: garcinia cambogia extract

  14. Link exchange is nothing else however it is just placing the other person's weblog link
    on your page at appropriate place and other person will also do
    same in favor of you.

    my page web page (

  15. Hi great website! Does running a blog such as this take a massive amount work?
    I've absolutely no knowledge of coding but I was hoping to start
    my own blog in the near future. Anyway, should you have any suggestions or tips for new blog owners please
    share. I understand this is off topic however I simply wanted to ask.

    Feel free to surf to my web blog Vottle classifieds for FREE PORN

  16. This is very nice blog,and it is helps for student's.Thanks for info
    .Net OnlineTraining

  17. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Online Training from India. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
    JavaScript Online Training from India


Visual Basic Online Course

Visual Basic Courses - Share