Database Programming with Microsoft Access

Submitted by coderz on

Microsoft Access is a DBMS that is known to almost all of us. Most of the computer professionals must have used this DBMS at least once in their lifetime. With the help of Microsoft Access we can easily create new relational databases, insert, and update and delete data. Microsoft Access has gained more popularity with its ability to relate one or more tables in the database.

Microsoft Access is known to be most easy to use database programming language. Firstly, you need to create tables and that can be easily accomplished using Microsoft Access table creating wizard. It is very important that the structure of your database is efficient and free from any type of redundancy or inconsistency. For this, it is advised that you follow the normalization techniques while designing your database.

New versions of Microsoft Access come with many applications that have been included in the package as standard features. With Microsoft Access, you can head start for using your database and manipulate it very easily whenever you desire or business requirements change. Some of the newly introduced feature includes WYSIWYG forms design, automatic field creation and fields with multiple values. All these features make your database programming task very easy.

All basic commands for database programming are available in the ribbon of the Microsoft Access. Most of the people are surprised to know that it offers around one thousand commands for database programming. The development area is clean as all the open objects are resided as a tabbed window which makes the management task very easy.  Microsoft Access allows its users to generate reports quickly and easily. You can also track and report information very easily with Microsoft Access information sharing and pre-built solutions.

Microsoft Access database can be accessed from your application once the connection is established between the database and your application. For this, you need to include Microsoft Access connection string in your application.

When we want to connect to the database by establishing ODBC with Microsoft Access then we follow approach depending upon the type of environment the application would work, that is, standard environment, workgroup environment or exclusive security environment. If you are using normal security and want to connect to Microsoft Access database then you should use the string:


”Driver= {MicrosoftAccessDriver(*.mdb)};
DBQ=C:\application\mydata.mdb;
Uid=myname;
Pwd=password;"

If your application needs to run in a workgroup environment then you will have to use the string: 
 
"Driver={Microsoft Access Driver (*.mdb)};
Dbq= C:\application\mydata.mdb;
SystemDB= C:\application\mydata.mdw;" 

Similarly, in an exclusive environment you will have use the string:

 "Driver={Microsoft Access Driver (*.mdb)};
DBQ= C:\application\mydata.mdb;
Exclusive=1;
Uid=myname;
Pwd=password;"

If you are working in a .NET framework and want to connect to the Microsoft Access database then you need to use the following connection strings:

To open connection to Microsoft Access database type the following string:

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source= C:\application\mydata.mdb; User Id=admin; Password=" 

To open connection to Microsoft Access database in a password protected environment type the following string:

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source= C:\application\mydata.mdb; Jet OLEDB:Database Password=password" 

To open connection to Microsoft Access database in a Workgroup environment type the following string:

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source= C:\application\mydata.mdb; Jet OLEDB:System Database= C:\application\mydata.mdw" 

To open connection to remotely located Microsoft Access database type the following string:

"Provider=MS Remote; Remote Server=http://Remote_Server_IP_Address; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source= C:\application\mydata.mdb" 

To open connection to Microsoft Access database in a shared network use the following string:

"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\Name_of_Server\Share_Name\Share_Path\mydata.mdb" 

Then all you need to do to manipulate the database is to write SQL statements.