Partager via


How to: Use Tables from Other Databases

You can use data from a table not associated with the current database.

Tip

To access a table associated with or not associated with a database, specify the full path. However, you can increase performance by using only the table name.

To use data from another database table

  • Perform one of the following:

    • Use the USE command with a question mark (?) to display the Use dialog box, and click Other.

    -OR-

    • Use the USE command and precede the table name with the database name followed immediately by an exclamation point (!).

      Tip

      The exclamation point is used to refer to a table in a database other than the current database.

    -OR-

    • Create a view in your database that references the table.

For more information, see USE Command and Working with Views (Visual FoxPro).

For example, the following code demonstrates how you can open a table named MyTable in another database called MyDatabase2 and browse the table:

USE MyDatabase2!MyTable
BROWSE

See Also

Tasks

How to: Open Tables (Visual FoxPro)

Other Resources

Working with Tables (Visual FoxPro)

Creating Databases

Working with Items in Databases