Create Database with Data Manager & View w/ Text/Data Control

Article translations Article translations
Article ID: 110753 - View products that this article applies to.
This article was previously published under Q110753
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

Summary

This article gives step-by-step examples of the following:

  • How to create a database with Visual Basic's DATAMGR.EXE Data Manager.
  • How to view a database using a text box bound to a data control.

More information

How to Create a Database Using Visual Basic's Data Manager

You can create a new database as follows:

  1. Open the Data Manager program by choosing it from the Window menu in Visual Basic or by running DATAMGR.EXE from the Windows File Manager.
  2. In the Data Manager, choose New Database from the File menu and select Access 1.1.
  3. Click the New button and enter tbl1 for the table name.
  4. Click the Design button. Then click the Add button. Enter fld1 for the Field Name and select Integer for the Field Type.
  5. Save this Microsoft Access database with the name TEST1.MDB. Close the Data Manager when finished.
You can add data to a database with the Data Manager by selecting a table and choosing the Open button. You can click Add; then enter data into the field(s) of the new record. Click Update, or click Add again to enter the next record. You can also scroll to any existing record, modify the data in any field, and then click the Update button to write the record to the table.

How to View a Database By Binding a Text Control to a Data Control

  1. Start a new project in Visual Basic. Form1 is created by default.
  2. Create a Visual Basic database (or Microsoft Access database) as described above. Name this database TEST1.MDB.
  3. Add the following controls to Form1, and set the following properties:
       Control Name  Property       New Value         NOTE
       ----------------------------------------------------------------------
       Data1         DatabaseName   C:\VB\TEST1.MDB   Database created above.
       Data1         RecordSource   tbl1              Valid table name.
       Text1         DataSource     Data1             Name of data control.
       Text1         DataField      Fld1              Valid field name.
    						
  4. To run the program, choose Start from the Run menu, or press the F5 key.
  5. Scroll through one record at a time in the database using the data control. View the contents of the Fld1 field in the text box. Close the form to end the program.

Data Manager

By using the DATAMGR.EXE Data Manager program provided with Visual Basic, you can do all this:

  • Create a database
  • Create new tables
  • Create an index
  • Open an existing database
  • Add fields to a table
  • Modify table data
  • Delete an existing table
  • Compact a database
  • Repair a database
The Data Manager gives you a subset of the features found in Microsoft Access for Windows. Data Manager, Visual Basic, and Microsoft Access all create the same database format, an .MDB file. An .MDB file contains the database structure as well as the data itself.

The documentation for Data Manager is found in Data Manager's Help menu.

Properties

Article ID: 110753 - Last Review: October 26, 2013 - Revision: 3.0
Applies to
  • Microsoft Visual Basic 3.0 Professional Edition
Keywords: 
kbnosurvey kbarchive KB110753

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com