Presentation is loading. Please wait.

Presentation is loading. Please wait.

AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.

Similar presentations


Presentation on theme: "AVCE ICT – Unit 7 - Programming Session 16 – Database and VB."— 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


Download ppt "AVCE ICT – Unit 7 - Programming Session 16 – Database and VB."

Similar presentations


Ads by Google