Solved - Access Connection

Posted on 2005-04-21
Last Modified: 2010-04-23
       Any one give me some example of Simply connection of with MS Access Database ( .mdb)
        with functionality like add,delete,update,select
        It should be preetymuch same like we are doing in Adodb connection in VB 6.0
Question by:vsvb
    1 Comment
    LVL 25

    Accepted Solution

    Well there are a couple of thisng you can do

    1. just drop a oledbdataadapter from the toolbox on your form and follow the wizard
    2. do something like this
    dim conn as new oledb.oledbconnection(Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Registry Path=;Data Source=""C:\Program Files\My APP\DlrData.mdb"" & _
            ";Jet OLEDB:System database=;Jet OLEDB:Global Bulk Transactions=1;Jet OL" & _
            "EDB:Don't Copy Locale on Compact=False;User ID=Admin;Provider=""Microsoft.Jet.OLE" & _
            "DB.4.0"";Jet OLEDB:Database Locking Mode=0;Jet OLEDB:SFP=False;Jet OLEDB:Encrypt " & _
            "Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Compact Without " & _
            "Replica Repair=False;Jet OLEDB:Global Partial Bulk Ops=2;Mode=Share Deny None;Ex" & _
            "tended Properties=;Jet OLEDB:Engine Type=4")

    dim da as new oledb.oledbdataadapter("select * from yourtable",conn)
    dim dt as new datatable

    to update delete insert data you can use a commandbuilder object which will regenate the command for you

    dim cb as new oledb.oledbcommandbuilder(da)
    'to update your data
    just use


    3. You can write the update/delete/insert commands yourself (just drag a oledbadapter from the toolbox and look in the windows generated code how it should be done)

    which one to use is your own preference (In 90% of the cases I use method 1, I never use method 2, and method 3 only if I have a special case (like many to many relationship or I need to do something special)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    I'm currently working for a company where I have to upgrade over 50 VB6 programs to VB.NET 2008.  So far I'm about half way through, and I've learned quite a few tricks that drastically improve the performance of VB.NET apps. Because there are a…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now