Wednesday, April 23, 2014

Visual Basic Tutorial : How to Add/Delete Record to MS Access Database Using Visual Basic 2010

The most popular visual basic programming is about the ability of the program to save records in to the database. 

With this database you can save thousands of records at once. In visual basic programming, the common database software used in visual basic is the Sql Database and Microsoft Access.. Though the programmers of both software made an update, still the methods of adding new records to database does not effect during the update.

According to mdsn.microsoft.com the with statement is:


Executes a series of statements that repeatedly refer to a single object or structure so that the statements can use a simplified syntax when accessing members of the object or structure. When using a structure, you can only read the values of members or invoke methods, and you get an error if you try to assign values to members of a structure used in a With...End With statement. -credits to microsoft.com

In our case we are using MS Access as our database record storage together with this tutorial..

Today, we are going to use two different software to make an exciting project, these two software are Visual Basic and Microsoft Access. 

Before we begin, let us go to the basic codes of saving new records to database...

The code we are going to use is the [With... End With Statement]


This is the basic structure of the with statement..
With objectExpression

.[ statements ]

End With
Let us start a small program that will allow us to add new record on ms database file.

I have a video tutorial with the whole process from creating a new project to database creation and connecting it to visual basic and coding to make it work..

Written Tutorial.. Steps

Step 1. Make new Database in ms access... Then Save it
Step 2. Open Visual Basic... Create new Project.
Step 3. Save the project.
Step 4. Copy the Saved Database you create on step 1 and navigate on this folder..


C:\Users\YourUsername\Documents\Visual Studio 2010\Projects\[saved project on step 3]\[saved project on step 3]\bin

Step 5. Once you are in the bin folder of the program you saved before, Paste the database there.. this is important for locating the database file during the coding phase.

Step 6. Watch this tutorial on how to connect the database to visual basic.





Assuming that you already connected the database to visual basic. We are going to add the code to save button to add new record to database..

Now that all the connection is all set, watch this video on how to insert and delete record on ms access database using visual basic 2008 - 2010.




1 comment:

  1. is titanium a conductor?
    titanium is a metal titanium bolt core of the Earth with its distinctive copper structure. citizen super titanium armor It titanium max is an alloy titanium dab tool formed by the omega seamaster titanium presence of iron, water, and

    ReplyDelete