Instructions for ADO -

Add the ADO Component from Project menu/components
    Microsoft ADO Data Control 6.0 (OLEDB)
    Set the Name property to adcAuthors

Set the Connection String Property
    Double-click on the property in the properties window
    Use Connection String and click Build button
    Select the Microsoft Jet 4.0 OLE DB Provider
   
Click on ... and find the Biblio database (Program Files/Visual Studio/VB98)
    Test the Connection
    Click OK to return to Properties page dialog
    Click Apply to set the connection String to be built:
    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=  FILENAME  ;Persist Security Info=False

Set the RecordSource Property
    Click the RecordSource tab
    In Command Type select 2-adCmdTable - you'll use a real database table
    Select Authors in the box and click OK

Binding Text Box Controls
    Align the ADODC control with the Align property
    Draw 3 text boxes & labels
    Set the caption properties of the labels to Author ID, Author Name, Year Born
   
Name the 3 text boxes txtAu_ID, txtAuthor, txtYearBorn

   
Click txtAu_ID then goto Properties
    Set DataSource property to the ADODC
    Set DataField property to the Author ID in the Authors table
    Set these 2 properties for the other 2 text boxes

Run it - try movePrevious, moveNext, moveFirst, moveLast


Install DataGrid

Project - Components
Microsoft DataGrid Control 6.0 (OLEDB)
Draw it on the form

Binding the DataGrid to a Recordset
Set the Name property of the DataGrid to dtgAuthors and DataSource property to adcAuthors

DataGrid Properties
AllowUpdate
AllowAddNew
AllowDelete


Last Update by DrB on Wednesday, February 18, 2009