1 / 15

AVCE ICT – Unit 7 - Programming

AVCE ICT – Unit 7 - Programming. Session 16 – Database and VB. In the real world. This is what VB is most used for The user is hidden from the complexities of the database There is a user friendly front end You have the full power of a programming language to manipulate data

Download Presentation

AVCE ICT – Unit 7 - Programming

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. AVCE ICT –Unit 7 - Programming Session 16 – Database and VB

  2. In the real world • This is what VB is most used for • The user is hidden from the complexities of the database • There is a user friendly front end • You have the full power of a programming language to manipulate data • The user doesn’t need to have MS Access installed on their machine

  3. Databound controls • These are the ones that can be bound to a database • DAO (the data aware objects databound control) • This is used to bind to Access 97 databases • ADODC (ActiveX Data Objects Data Control) • This is used to bind to Access 2000 format databases

  4. Data aware controls • These can be associated with a databound control and can be used to display data items • Text boxes • Labels • List and combo boxes • Data grid • MS Flexgrid plus others

  5. Binding • For the DAO data control, set the Database Name property and then the Record Source property to the table name • For the ADO, use an ODBC Data Source Name (DSN) which is very simple to set up

  6. Binding - DAO Click on the option list to select the database The Jet Engine is the standard MS engine for searching the database

  7. Binding - DAO This is the table name but it could be a Query that you have created in Access

  8. Binding - ADO The Connection String property specifies the database

  9. Setting up the DSN Select 32bit ODBC data sources from within control panel

  10. Setting up the DSN Select Add and then select the Microsoft Access Driver followed by Finish

  11. Setting up the DSN Select the Database and then choose a suitable Data Source Name, then click OK

  12. Design time coding • Once you have created the DSN and used that to set the Connection String property of the ADODC, you can use tools such as the Data Form Wizard (on the Add Form choices) to create a form containing all of the controls needed to access data

  13. Queries • A query can be used as a DSN in its own right • You can also create and run queries within VB at run time • Databases are manipulated using the very high level language called Structured Query Language or SQL (sometimes pronounced Sequel)

  14. Assignment task • A database isn’t necessary for the project but • You could create a database to hold user ID, number pairs • The database could be queried to authenticate the user • This would be a very impressive addition!

  15. Return to Main Menu

More Related