1 / 16

Welcome to Database Programming. MS Access DB Objects

Welcome to Database Programming. MS Access DB Objects. Database Table Fundamentals. Data is stored in tables. The data is arranged in rows & columns much like a spreadsheet.... Your Access DB has a “.MDB” file extension. Database Table Fundamentals.

kare
Télécharger la présentation

Welcome to Database Programming. MS Access DB Objects

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Welcome to Database Programming.MS Access DB Objects

  2. Database Table Fundamentals... • Data is stored in tables. • The data is arranged in rows & columns much like a spreadsheet.... • Your Access DB has a “.MDB” file extension

  3. Database Table Fundamentals...

  4. You use design view in Access to create your table. You control the data type for the field and you make a unique or primary field which identifies each record. CustID is my primary field. Notice the small key symbol.

  5. ADO DataBase Model(Active-X Data Access Objects) Step 1:The Connection object is used to talk to the DB. We give it the location and type of db and it knows how to communicate with our DB.

  6. ADO DataBase Model(Active-X Data Access Objects) Step 2: The Data adapter is used to actually read/write our data. It is designed specifically for the type of DB we are using. For MS ACCESS, we use the OleDbDataAdapter control.

  7. ADO DataBase Model(Active-X Data Access Objects) Step 3:We use a DataSet to hold our data in RAM. We actually work with this data and we do not directly manipulate the DB table. A dataset can hold more than one table of information if you like.

  8. ADO DataBase Model(Active-X Data Access Objects) Step 4:We use controls on our form to display the data. Each textbox is “bound” to or associated with a field in the DB table we are using. We can use buttons to navigate through the dataset to display our records.

  9. Steps for Building a DB Front-End Application Using a DataGridView Control... Step 1: • Create your form and rename it if you like. • Drag DataGridView Control to the form • Use the smart tag to choose New Data Source.

  10. Step 2: The control will launch the Configuration wizard

  11. Step 3: Choose New connection and browse to your .mdb file then click next.

  12. Step 4: Change the data source to MS Access and navigate to the database using the browse button. Choose Yes if you want the DB to be copied to the project folder or not.

  13. Step 5: You can decide to copy the connection string to the project folder in the app_config file. This is a good idea so choose “Yes”.

  14. Step 6: Add the table you want to use and click finish. We will select all fields. Or you can click on the ones you want then click “Finish”.

  15. Step 7: You will then see the table with your data displayed. For this project, we did not allow edit, updates, or deletes.

  16. Step 8: Run your app. You can sort columns by clicking on a grid column. Notice the column headers may not look too good. I will show you how to change those so they say exactly what you want.

More Related