Adding records - data control, Visual Basic Programming

Adding Records:

1. As in the earlier case Set the DatabaseName property as "C:\ex.mdb", now Set the Record Source for the data control as Customer and Set the Record Type to 0.

2. Design a form with 5 text boxes and 2 command buttons new and update.

3. Put the DataSource to Data1 for all the text boxes.

4. Place the DataField property for each and every text box to the various fields of the Customer table.

5. Handle the Click event for new command button and type the handler as shown below:

data1.RecordSource = "Customer"

data1.Refresh

data1.Recordset.AddNew

Now Add New adds a buffer in the memory for a new record.

6. Handle the Click event for the command button, update it and type the handler as shown below:

data1.Recordset("Id") = CInt(text1.Text)

data1.Recordset("name")= text2.Text

data1.Recordset("address")= text3.Text

data1.Recordset("city")= text4.Text

data1.Recordset("state")= text5.Text

data1.Recordset.Update

Now update marks the record into the database.

Posted Date: 10/10/2012 1:09:22 AM | Location : United States







Related Discussions:- Adding records - data control, Assignment Help, Ask Question on Adding records - data control, Get Answer, Expert's Help, Adding records - data control Discussions

Write discussion on Adding records - data control
Your posts are moderated
Related Questions
You are asked to create the LOTO game customized according to the following constraints: 1. Create a grid containing 20 numbers (20 buttons: button1, button2, …button20) 2. When t

I have all my program done except the loan part that I am having a lot of troubles with

write a detailed account on ADO.net architecture.

For naming anything variable names follow the standard rules in VBScript. A variable name: Should begin with an alphabetic character. Cannot have an embedded period. Sh

A For Each...Next loop is similar to a For...Next loop. Rather than repeating the statements a particular number of times, For Each...Next loop repeats group of statements for each

While several operations take place in an expression, each part is evaluated & resolved in a predetermined order called operator precedence. You can employ parentheses to override

Hi, i need help in vb.net for the pelmanism game. I will appreciate if you can get back to me please

THREE MODELS FOR USER INTERFACE DESIGN   The 3 models for the user interface design are the implementation model, mental model &the manifest model. The Implementation Mod

Numeric data types: The Integer, long integer are used for entire numbers. Single and doubles are related with the floating point numbers. Currency is related with numbers dea

MODELESS DIALOG The Dialog boxes are either modal or modeless. The modal dialog box should be closed (Unloaded or hidden) before you can continue the working with the rest of t