Creating a report with a Visual Basic Data Project
OLE DB Object Services is compatible with Visual Basic Data Projects.
This procedure explains how to create a report with a VB Data Project. For general information about ADO, see the ActiveX Data Objects documentation from Microsoft.
- Start a new Data Project in VB.
- To access the DataEnvironment1 section, double-click DataEnvironment1 from the Project Window.
- Click Connection1 in the DataEnvironment1 section.
-
Specify the ConnectionSource property of
Connection1 to:
"Provider=Lawson.LawOLEDBC;Password=XXX;User ID=XXX;Data Source=XXX;Persist Security Info=True"
- Specify the CursorLocation property to adUseServer.
- Right-click on Connection1 and select Add Command.
- Click Command1 in the DataEnvironment1 section.
- Specify the CommandType property to adCmdTable.
- Specify the CommandText property to DEPTCODE.
- Specify the CursorLocation property to adUseServer.
- Specify the CursorType property to adOpenStatic.
- Specify the LockType property to adLockReadOnly.
- To limit the number of records, specify the MaxRecords property.
-
Paint the report.
- To open the data report designer window, double-click on DataReport1 from the Project Window.
- Position the DataEnvironment1 section and the report designer window so both windows are visible. Click the plus symbol in the DataEnvironment1 section so that the fields of the DEPTCODE table are visible.
- Click the NAME field and drag it to the detail section of the data report. After you drop the NAME field on the detail section of the data report, click the white space area of the detail section to deselect what you dropped.
- Select the NAME: portion of what you dropped and drag it to the Page Header portion of the report. Move the NAME[Command1] part so that it is beneath the NAME: heading.
-
Finish setting up the report.
- Click the DataReport1 window bar so that the DataReport1 properties is displayed in the property window.
- Specify the DataSource property to DataEnvironment1.
- Specify the DataMember property to Command1.
- Specify the Startup Object property in the Project Properties dialog to DataReport1.
- Run the project.