Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

Inserting Rows in Batch

See Also
Quick Tour
Batch Insert Form

The Batch Insert Form allows users to insert rows in batch, that is, to insert more than one record into the database by using only one command. We implement this functionality using parameter arrays and SQL statements.

Users navigate to the Batch Insert form by clicking on the Batch Insert button on the Employee form. The Batch Insert form has a grid that displays the entered data and a row of text boxes where the user enters each record. (We make the user enter records here because the Visual Basic grid does not allow user updates.) To keep our example simple, we allow the users to enter only Employee Number, Employee Name, and Department Number fields.

The user enters a record in the text boxes and clicks on the "Add to Grid" button. The program displays the entered records in the grid. To insert the whole batch to the database, the user clicks on the "CommitGrid" button.

The batch insert form uses three procedures. The Form_Load() procedure initializes the grid with the column headers. The CmdAddtoGrid_click() procedure copies the entered data from the text boxes to the grid. The CommitGrid_Click() procedure contains the parameter array and SQL statement code used to make the batch insert. Refer to the following sections or click on the button in the Batch Insert Form window:

Coding the Batch Insert Form_Load() Procedure

Coding the CmdAddtoGrid() Procedure

Coding the CommitGrid_Click() Procedure