How to Update an Access Database in Code

How to Update an Access Database in Code thumbnail
Edit your Access database in your SQL code.

An Access database allows you to have a small, desktop database engine for storing important records. You create, edit and delete Access database records using Structured Query Language (SQL). Access has an editor in which you type your code into queries. The coded queries then perform a function such as updating and editing values in the tables. You can create this code in your Access database software.

Instructions

    • 1

      Open Microsoft Access. In the main menu, click the "Queries" button to view a list of queries programmed into the database. Click the button labeled "Create New Query in Design View." This will start a wizard.

    • 2

      Double-click the table where the field you want to update is located. Click "Close" to view a graphical interface of your table and the update query options. Click the "Query Type" button and select "Update."

    • 3

      Drag and drop a field from the table to the grid at the bottom of the window. The field you drag and drop to the grid is the one used as the "where" clause. Without a "where" clause, the entire table is edited. The "where" clause filters only the records you want to update.

    • 4

      Add the "where" clause filter value. For instance, if you want to edit only the customer records whose last name is "Smith," enter "smith" into the "Criteria" text box. Enter the new value in the "Update To" text box.

    • 5

      Click the "Save" button. This prompts you for a name for the query. Enter a name and click "OK." To test your new query, double-click it. This will execute the query and update your database records.

Related Searches:

References

  • Photo Credit computer image by fotografiche.eu from Fotolia.com

Comments

You May Also Like

Related Ads

Featured