Download Wiley Beginning Visual Basic 2005 Databases
Transcript
Databases Name and Last Name. These two fields in a single record describe the name of a single person, as illustrated in Figure 1-1. Figure 1-1 Queries A query in a database is a group of Structured Query Language (SQL) statements that enable you to retrieve and update data in your tables. Queries can be used to select or update all the data in one or more tables or to select or update specific data in one or more tables. SQL enables you to insert, update, and delete data in a database. Microsoft Access provides wizards and visual tools that enable beginning programmers to write queries without having to know SQL. Using database query objects can make your Visual Basic 2005 code simpler because you have fewer SQL statements included in your code. Database query objects can also make your programs faster because database engines can compile queries when you create them, whereas the SQL statement in a Visual Basic 2005 program needs to be reinterpreted every time it’s used. They also provide ease of maintenance because changing a query in your database affects only the database and not your compiled program, which may have been distributed to one or more users. To understand the implications that queries can have on your programs, you need to learn some basic SQL, which you do in Chapter 4. SQL Ser ver Databases A SQL Server database is more complex than an Access database and the actual database engine for SQL Server is made up of multiple components. Also, unlike in an Access database, you cannot simply copy a SQL Server database file and distribute it because SQL Server databases consist of multiple files. Procedures must be followed before you can copy and distribute the database files for a SQL Server database. SQL Server comes in several editions, such as Microsoft SQL Server 2005 Express, Standard edition, and Enterprise edition. However, the components that make up the SQL Server database engine are virtually the same for all editions. Many components, other than the database engine and database files, make up SQL Server. These include such components as Replication, Data Transformation Services (DTS), Analysis Services, Meta Data Services, and English Query. However, those components are beyond the scope of this book, as you will be focusing your attention on the actual objects that make up a SQL Server database. 3