Page 239 - Open Soource Technologies 304.indd
P. 239
Unit 10: Database Fundamentals and Connectivity Option
HOME_AGE Number (Long Integer) Age in years of the home. (A
better table design choice would
be to have this field be the date
in which the property was built
and have the application com
pute the age based on the cur
rent date.)
BEDS Number (Long Integer) Number of bedrooms in the
property.
BATHS Number (Single) Number of bathrooms in the
property (allows for a decimal
value such as 2.5, indicating 2 ½
bathrooms – i.e., 2 full bath
rooms and 1 “powder room”).
FOOTAGE Number (Long Integer) The footage of the property.
ASKING Number (Long Integer) Asking price of the property in
whole dollars.
BID Number (Long Integer) Bid amount of the potential
buyer in whole dollars.
SALEPRICE Number (Long Integer) Sale price (amount the property
actually sold for) in whole
dollars.
Before coding or running sample application 2 or 3, we must set up an ODBC data source as was
done for the previous sample application. After downloading the file, move it to the folder of
choice. Then follow the exact same steps as before to set up the DSN, with these two exceptions:
(1) On the ODBC Microsoft Access Setup dialog box, type PropDB for the Data Source Name.
(2) In the Select Database dialog box, navigate to the location where we have placed the
PROPERTY.MDB file.
10.5 SQL Server (Structured Query Language)
10.5.1 Overview
Visual Basic developers have long used Access databases as a solution for local storage of
application data. Access made it very simple to ship a database with application, and connecting
to the database was no more complicated than putting the path to the database in the connection
string. For more complex scenarios, developers could scale up to the Microsoft Desktop Storage
Engine (MSDE). This provided developers with SQL Server functionality and reliability, but at
the expense of ease of use. With MSDE, we had to attach databases before they could be connected
to. When the application shut down, the database file was still in use by the MSDE engine,
making uninstall and reinstall more complicated. MSDE also did not provide any administrative
interface, so any administration of the database had to be done through command line tools. In
addition, MSDE was difficult to deploy with an application.
LOVELY PROFESSIONAL UNIVERSITY 233