Description of Implementation & Problems Faces --

advertisement
Description of Implementation
&
Problems Faces
--Project Deliverable 3
Darren Suprina
NJIT, CS-631-101, Fall
Instructor: Dimitrios Theodoratos
2007-12-07
Table of Contents
1.
1.1
1.2
1.3
1.4
Description of Implementation
Microsoft XP and VMware GSX 1.0.4
Using the MySQL Database
Database Driver Library ADODB
Excel as the GUI
2.
2.1
2.2
2.3
2.4
Problems Faced
Challenging Technical Assembly
Inherent Limitations of Excel
Management of Detail
Scope Creep
3.
Credits
Appendices
Appendix A - Installing & Configuring MySQL 5.1
Appendix B - Database Creation Script
Appendix C – Interfacing Excel to MySQL
12/11/2007
Implementation & Problems
2
1. Description of Implementation
The Library database was constructed in three tiers, consisting of the MySQL open
source database, Microsoft ADODB database driver library, and Microsoft Excel as the
GUI execution engine.
1.1 Microsoft XP and VMware GSX 1.0.4
The Library project was implemented using the Microsoft XP SP2 / fully patched
environment, installed as a VMware GXS server v1.0.4 virtual machine. This was done
so as to insure that any environment-specific configuration parameters (such as
classpath), as well as any supporting executables requiring specific file system placement
could be accommodated without impact on any physical system. Additionally, this
configuration made the project portable, as the virtual machine may be copied to any
other system running the GSX 1.0.4 server.
1.2 Using the MySQL Database
MySQL version 5.1 (the latest available at the time of this project’s inception) was
selected for four (4) reasons. First, it was freely available. Second, extensive tools were
available for those seeking to do development using MySQL. Third, documentation was
available in an on-line searchable (hypertext) form featuring a Wiki-like comment stream
on each subsection, which seemed to address many basic use issues. Finally, multiple
forums of users with experience exist in support of the MySQL database.
Ultimately the available tools were not required, as the installation, configuration, and
use of the database proved to be reasonably simple. Additionally, none of the public
forums or user groups were used as the on-line documentation and user web sites offering
VB / MySQL advice proved sufficient to complete the project.
1.3 Database Driver Library ADODB
Microsoft’s ADODB MySQL interface module was used to enable the Microsoft Excel
execution engine to communicate with the MySQL database. This module was freely
offered by Microsoft, and both installed and configured with minimal effort.
1.4 Excel as the GUI
Microsoft Excel 2003 was chosen as the execution environment because of its support for
tabular data, graphical design elements, and Visual Basic. While Excel does support
macro functionality, this was almost exclusively avoided in favor of VB procedures
(which do not return values) and functions (which do).
12/11/2007
Implementation & Problems
3
2. Problems Faced
The implementation of the Library database proved to be considerable challenge in its
technical assembly, inherent limitations of Excel, the management of detail, and scope
creep.
2.1 Challenging Technical Assembly
It was decided that a mixed approach of top-down design of the desired functionality
coupled with a bottom-up design of the underlying support functions would be used. As
a result the GUI rapidly took shape and several iterations were tried and rejected until a
design involving just 6 distinct worksheets (for the project’s core functionality) was
ultimately settled upon. This process took longer than anticipated.
The coding of underlying routines to interface with the database driver (Microsoft
ADODB v2.5) initially appeared to be a simplistic task based on the availability of
sample routines for functions such as reading and inserting against MySQL.
Unfortunately free software is rarely free of bugs, and an inordinate amount of time was
spent troubleshooting this required functionality.
While the basic documentation of ADODB appears complete (offering an error code list
literally hundreds of entries long), obtaining documentation specific to the practical use
of this glue code proved an exhaustive process. Ultimately it was necessary to
experiment with various VB interface utilities which make use of ADODB so as to
ascertain the actual success and error codes one was likely to encounter and then wrap or
modify those interface utilities for ease of use. This process consumed significant time.
In one notable case, the process of using the SQL built-in function TO_DAYS (which
converts a date into the number of days since the start of the (UNIX) epoch in support of
date arithmetic) proved to be problematic. Specifically a minor bug in ADODB
prevented the successful execution of statements such as:
TO_DATE(R.RDate) – TO_DATE(R.BDate) + 1
(The function shown above calculates the number of days a Reader borrowed a given
document for.) While the command-line interface to the database supported the syntax as
shown, ADODB insisted on something different:
(TO_DATE(R.RDate) – TO_DATE(R.BDate)) + 1
Such SQL parsing difficulties also showed up while attempting to join (via the UNION
keyword) to union-compatible SELECTs, and then applying an ORDER BY on the
result. The mandatory insertion of extra whitespace characters impacted the time
ultimately required to code such functionality as “Computing the year’s 10 most popular
books”
In contrast, the open source community supporting MySQL provided a significant wealth
of detail regarding the practical use of the database, including comments made directly to
12/11/2007
Implementation & Problems
4
database manual pages covering the use of such SQL constructs as nested queries, the
handling of date and time variables, and the use of AUTO INCREMENT, UNIQUE, and
UNIQUE KEY keywords (which proved to be necessary to support the proper and
automatic generation of key values.
Additionally, the use of VMware as a container of the entire deliverable was very useful
in making the project portable. This enabled development to continue despite business
travel, and facilitated the backup of the entire execution environment in an easy-torecover format.
2.2 Inherent Limitations of Excel
The use of Microsoft Excel as the GUI execution environment was ultimately a poor
choice as graphical elements provided by the engine were not significantly leveraged.
Excel’s isolation of functionality into distinct containers (workbooks) imposed significant
restrictions on how various modules (classes) of code interacted, necessitating the design
and implementation of a variety of workarounds.
Excel’s support of VB is somewhat more limited than stand-alone Visual Basic
implementations. The practical downside was that a fair amount of the syntax, and much
of the default libraries associated with the language were not available for use,
necessitating their replacement as needed. Additionally, VM supports only weak type
checking, which complicated development as issues such as the inadvertent assignment
of a string to an integer variable would not be flagged as requiring attention as long as the
string provided actually contained a numeric value. This late binding & assumed data
type conversions complicated debugging as type mismatch errors were not uncommon.
In retrospect, where this project being attempted anew, it is likely that either Java or C++
would have been used (for their strong type checking), and coupled to an Tomcat /
Browser GUI for a more free-form GUI result.
2.3 Management of Detail
Keeping track of all the software procedures, functions, methods, and their interrelations /
hierarchies is not supported with Excel’s VB. The lack of such tools proved to be a
significant impactor on the rate at which the project could be coded and debugged.
2.4 Scope Creep
There was a desire to add features and functionally which ultimately had to be contained
in order to complete the project on-time. There was a tremendous desire expand the
scope of the project and include functionality that might be found in the design of a
“Live” database system. Ultimately choices were made so as to limit the scope of
additional features so as to complete the project within the bounds of the semester.
12/11/2007
Implementation & Problems
5
It is noteworthy that three minor changes were required to the database schema in support
of the project. First, it was determined that table RESERVATION contained attributes
which together formed a Foreign Key to table DOCUMENT. One of those attributes did
not share the same attribute name across both tables, preventing the use of Natural Joins.
This was corrected.
Second, there was no indication associated with each Reader as to which branch they
were associated with by default. The attribute was added to table READER.
Finally, a design decision made early in the project (when the original EER diagram was
proposed) called for the use of the RESERVATION table to hold Tentative, Reserved,
Borrowed, and Returned records. (A Tentative reservation is one where a Reader is
waiting for a copy of a document to be returned, whereas a Reserved reservation is one
which can be “picked up” immediately.) This proved to quicken the process of
development as several operations involving the limiting, counting, or reporting on a
Reader’s use of the database were easily implemented by treating reservations in a
common manner irrespective of their place in time (to be confirmed, confirmed, active, or
old).
3. Credits
It is noteworthy that specific portions of the VB code used in the Library project were
obtained from Internet sources such as Microsoft’s MSDN online documentation and
associated public forums. Specifically:

The core functionally used in subroutine xConveryYXPairsToRange, which is
found in source file “ThisWorkbook.doc”, was obtained from an Internet source.

The core functionality used in string validation (determining if a string was
numeric, alphabetic, or alphanumeric), which is found in source file
“ThisWorkbook.doc”, was obtained from various Internet sources. Specific
functions which used this code are xStringIsAlphabetic, xStringIsNumeric,
xStringIsAlphanumeric, xStringIsAlphanumericAndSpaces, and
xStringIsNonSpacePrintable

The core functionality found in the database access routines required to use
ADODB to talk to MySQL came from Internet sources. The impacted functions
found in “ThisWorkbook.doc” are xDbConnect, xDbDisconnect, xDbRead,
xDbReadGetRecordCount, xDbReadCurrentRecordAttribute,
xDbReadGotoNextRecord, xDbInsert, xDbUpdate, and xDbDelete.

Code enabling the conversion of Excel’s cell naming convention (i.e.: $B$4) to
Y,X coordinates is found in all worksheet source code with subroutines named
Worksheet_Change and Worksheet_BeforeDoubleClick. This functionality was
obtained from an Internet forum.
12/11/2007
Implementation & Problems
6
Appendix A – Installing & Configuring MySQL 5.1
1. Installing MySQL
Version 5.1.22 of MySQL was used. MySQL may be downloaded from a variety of
mirror sites referenced by http://dev.mysql.com/downloads/.
1.1
Obtain MySQL
Download file “mysql-5.1.22-rc-win32.zip” from a MySQL mirror site.
MySQL can be downloaded from a variety of mirror sites referenced by
http://dev.mysql.com/downloads/.
1.2
Launch the Installer
Launch “mysql-5.1.22-rc-win32.zip”. The archive will automatically decompress in
support of the installation.
When the file “Setup” is presented, launch it.
Publisher’s certificate will not be recognized. Ignore this error. Click <Run>.
The MySQL Server 5.1 Setup Wizard will start.
1.3
Installing MySQL using the Setup Wizard
When the wizard is presented, acknowledge: <Next>
Select the Complete setup type. This is NOT the default.
Click <Install> to start the installation. A progress bar will be presented. When setup
wizard is complete, the MySQL Enterprise screen will be presented.
1.4
Using the MySQL Enterprise Wizard
12/11/2007
Implementation & Problems
7
When the screen is presented, acknowledge: <Next> <Next>
Elect to configure the MySQL Server now (the default). Select <Finish>. The Server
Instance Configuration Wizard will start.
1.5
Using the MySQL Server Instance Configuration Wizard
12/11/2007
Implementation & Problems
8
Select <Next>.
Elect to perform a Detailed Configuration (the default), then select <Next>.
12/11/2007
Implementation & Problems
9
Select to set up MySQL as a developer machine (default configuration), then select
<Next>.
Select to set up MySQL as a Multifunctional Database (default configuration), then select
<Next>.
12/11/2007
Implementation & Problems
10
Accept the default locations for MySQL installation and the database files (C:\My
Desktop\My Documents\InnoDB Datafiles), then select <Next>.
Select the maximum number of concurrent database connections. The default (Decision
Support (DSS/OLAP) – 20 connections maximum) is reasonable. Then select <Next>.
12/11/2007
Implementation & Problems
11
Configure the networking interface for MySQL:
 Enable TCP/IP Networking Yes
 Port Number 3306
 Enable Strict Mode Yes
(the default)
(the default)
(the default)
Then select <Next>
12/11/2007
Implementation & Problems
12
Select the character set to use. The Standard Character Set is recommended (and is the
default). Then select <Next>.
Configure how MySQL binaries will be used:
 Select to have MySQL start automatically with Windows as a service (the
default).
 Select the service name of “MySQL” (the default)
 Select to launch the MySQL Server atomically (the default).
 Elect NOT to include the MySQL bin directory in the Windows path (the default).
Then select <Next>.
12/11/2007
Implementation & Problems
13
Provide access credentials:
 Select to modify the security settings.
 Provide a root password:
sun123
 Enable root access from remote machines.
 Select to NOT create an anonymous account.
(Default)
(A change)
(Default)
Then select <Next>.
12/11/2007
Implementation & Problems
14
Select <Execute> to start the installation process based on the configuration parameters
selected.
Select <Finish> when the installation process has completed.
2.
Creating the Library Database
2.1
Launch the MySQL command line interface
<Start><Programs><MySQL><MySQL 5.1><MySQL Command Line Client>
Enter the root password when asked.
Access can also be obtained manually:
 Start a Windows command tool.
 cd C:\Program Files\MySQL\MySQL Server 5.1\bin\
 mysql –h localhost –u root –p
 Enter the password (sun123) when prompted.
2.2
Use Script to Define Database Tables and their Relationships
Batch script “Create database library <version>.txt” can be used to create a fresh copy of
the Library database. The string <version> is replaced by the latest version of the script
provided. This script will create all required tables, establish Primary Keys, Foreign
Keys, Unique Keys, and referential integrity constraints.
The script is invoked as follows:
12/11/2007
Implementation & Problems
15




Start a Windows command tool.
cd C:\Program Files\MySQL\MySQL Server 5.1\bin\
mysql –h localhost –u root –p Create database library <version>.txt1
Enter the password (sun123) when prompted.
mysql -h localhost -u root -p < "C:\Documents and
Settings\Administrator\Desktop\MySQL Scripts\Create database Library <version>.txt" >
"C:\Documents and Settings\Administrator\Desktop\MySQL Scripts\log.txt”
mysql -h localhost -u root -p -e "C:\Documents and
Settings\Administrator\Desktop\MySQL Scripts\Create database Library <version>.txt" >
"C:\Documents and Settings\Administrator\Desktop\MySQL Scripts\log.txt”
mysql -h localhost -u root -p -e "source C:\Documents and
Settings\Administrator\Desktop\MySQL Scripts\a.txt" --force
(To gain access to the same database in the future, may launch the shell request directly:
cmd> mysql –h <host> -u <user> -p <database name>)
2.3
Fill the Database with Sample Data
The Excel UI GUI supports the generation of Library database content, including a
selection of users (and their credentials), library branches, documents of various types
(books, journals, and conference proceedings), authors and editors tied to their respective
document types, and a selection of documents allocated to various branches of the
library.
Note that no existing reservations have been defined. This is left as an exercise for the
user.
To fill the database with this predefined content, select the <CreateContent> worksheet
and click the yellow “Create Content” button found in the upper right-hand corner of that
worksheet. SQL statements will be written to the worksheet <CreatedContent>.
Copy column “A” (from approximately A10 to A835) to a Windows command prompt
shell running the MySQL command line interface. (See section 2.1 for details on running
this shell.)
1
Sample invocation shown. Use the latest version of the “Create database library” script.
12/11/2007
Implementation & Problems
16
Appendix B – Database Creation Script
This appendix provides a series of SQL statements suitable for creating the Library
database.
#---------------------------------------------------------------------# File:
Create database library 0013.txt
# Date:
11/21/2007
# Author:
Daren Suprina
#
# Description:
# This MySQL batch file creates the “Library” database and all of its
# tables. Primary Keys are specified using the PRIMARY KEY directive,
# and Foreign Keys are specified using the REFERENCES directive.
#
# Use:
# To create the Library database, use the mysql command “mysql”
typically
# Found at C:\Program Files\MySQL\MySQL Server 5.1\bin\ on Windows
# > mysql –h <hostname> -u <username> -p -e "source <batch file>" -force
#
# WARNING:
# This script will cause the existing copy of the Library database to
be
# Deleted if it already exists. All data in that database will be
lost.
#---------------------------------------------------------------------Drop database library;
Create database library;
Use library;
Show tables;
/* Old DOCUMENT was here */
Create table BRANCH
(
LibID
auto_increment,
Name
AddrNumber
AddrStreet
AddrCity
AddrState
AddrZip
Unique key
Primary key
int unsigned
not null unique
varchar(60)
int unsigned
varchar(30)
varchar(30)
char(2)
char(5)
not
not
not
not
not
not
null,
null,
null,
null,
null,
null,
(Name),
(LibID)
);
/* Note:
Want the following to be in BRANCH, but since not a complete Foreign
Key
of DOCUMENT, it is not seen as legal:
Foreign key
(LibID)
References DOCUMENT (LibID)
on update cascade
12/11/2007
Implementation & Problems
17
on delete restrict
*/
Create table PUBLISHER
(
PublisherID
auto_increment,
Name
AddrNumber
AddrStreet
AddrCity
AddrState
AddrZip
Unique key
Primary key
int unsigned
not null unique
varchar(60)
int unsigned,
varchar(30),
varchar(30)
char(2),
char(5),
not null,
not null,
(Name),
(PublisherID)
);
Create table DOCUMENT_TITLE
(
DocumentID
int unsigned
auto_increment,
Title
varchar (256)
IsReference
char(1)
PubDate
date
Value
decimal(5,2)
PublisherID
int unsigned
Unique key
Primary key
Foreign Key
(PublisherID)
not null unique
not
not
not
,
not
null,
null,
null,
null,
(Title, PubDate, PublisherID),
(DocumentID),
(PublisherID)
References PUBLISHER
on update cascade
on delete restrict
);
/* Note:
Want the following to be in BRANCH, but since not a complete Foreign
Key
of DOCUMENT, it is not seen as legal:
Foreign key
(DocumentID)
References DOCUMENT
(DocumentID)
on update cascade
on delete restrict
*/
create table DOCUMENT
(
DocumentID
LibID
DocNumber
Position
Status
Primary key
Foreign Key
Foreign Key
(DocumentID)
12/11/2007
int unsigned
int unsigned
int unsigned
varchar(30)
char(1)
not
not
not
not
not
null,
null,
null,
null,
null,
(DocNumber, DocumentID, LibID),
(LibID)
References BRANCH (LibID)
on update cascade
on delete restrict,
(DocumentID)
References DOCUMENT_TITLE
Implementation & Problems
18
on update cascade
on delete restrict
);
Create table READER
(
ReaderID
auto_increment,
Status
NamePrefix
NameFirst
NameMiddle
NameLast
AddrNumber
AddrStreet
AddrCity
AddrState
AddrZip
Phone
Email
HomeBranch
Unique key
Primary key
Foreign Key
int unsigned
not null unique
char(1)
varchar(4)
varchar(15)
varchar(15),
varchar(15)
int unsigned
varchar(30)
Varchar(30)
char(2)
char(5)
char(10)
varchar(60),
int unsigned
not null,
not null,
not null,
not
not
not
not
not
not
not
null,
null,
null,
null,
null,
null,
null,
not null,
(NamePrefix, NameFirst, NameMiddle, NameLast),
(ReaderID),
(HomeBranch)
References BRANCH (LibID)
on update cascade
on delete restrict
);
Create table CREDENTIALS
(
Username
varchar(15)
Password
varchar(15)
IsReader
boolean
IsAdmin
boolean
ReaderID
int unsigned
Primary key
Foreign Key
(Username),
(ReaderID)
not
not
not
not
not
null unique,
null,
null,
null,
null,
References READER (ReaderID)
on update cascade
on delete cascade
);
Create table RESERVATION
(
ReservationID
int unsigned
auto_increment,
LibID
int unsigned
DocumentID
int unsigned
DocNumber
int unsigned,
BDate
date,
BTime
time,
RDate
date,
RTime
time,
Status
char(1)
ReaderID
int unsigned
Primary key
Foreign Key
12/11/2007
(ReservationID),
(LibID)
not null unique
not null,
not null,
not null,
not null,
references BRANCH (LibID)
on update cascade
Implementation & Problems
19
Foreign Key
(DocumentID)
(DocumentID)
on delete restrict,
references DOCUMENT_TITLE
on update cascade
on delete restrict,
Foreign Key
(DocNumber, DocumentID, LibID)
references DOCUMENT
(DocNumber, DocumentID, LibID)
on update cascade
on delete restrict,
Foreign Key
(ReaderID)
references READER (ReaderID)
on update cascade
on delete cascade
);
Create table BOOK
(
DocumentID
ISBN
Unique key
Primary key
Foreign Key
(DocumentID)
int unsigned
char(10)
not null unique,
not null,
(ISBN),
(DocumentID),
(DocumentID)
references DOCUMENT_TITLE
on update cascade
on delete restrict
);
Create table AUTHOR
(
AuthorID
auto_increment,
NamePrefix
NameFirst
NameMiddle
NameLast
Unique Key
Primary key
int unsigned
not null unique
char(3)
varchar(15)
varchar(15),
varchar(15)
not null,
not null,
not null,
(NamePrefix, NameFirst, NameMiddle, NameLast),
(AuthorID)
);
Create table BOOK_WRITTEN_BY
(
AuthorID
int unsigned
DocumentID
int unsigned
Primary key
Foreign key
Foreign Key
not null,
not null,
(AuthorID, DocumentID),
(AuthorID)
References AUTHOR (AuthorID)
on update cascade
on delete restrict,
(DocumentID)
References BOOK (DocumentID)
on update cascade
on delete restrict
);
Create table JOURNAL
(
JournalID
auto_increment,
12/11/2007
int unsigned
not null unique
Implementation & Problems
20
Scope
varchar (256)
primary key
(JournalID)
not null,
);
create table JOURNAL_EDITOR
(
EditorID
int unsigned
auto_increment,
NamePrefix
char(3)
NameFirst
varchar(15)
NameMiddle
varchar(15),
NameLast
varchar(15)
Unique Key
Primary key
not null unique
not null,
not null,
not null,
(NamePrefix, NameFirst, NameMiddle, NameLast),
(EditorID)
);
create table VOLUME_EDITOR
(
VolEditorID
int unsigned
auto_increment,
NamePrefix
char(3)
NameFirst
varchar(15)
NameMiddle
varchar(15),
NameLast
varchar(15)
Unique Key
Primary key
not null unique
not null,
not null,
not null,
(NamePrefix, NameFirst, NameMiddle, NameLast),
(VolEditorID)
);
create table JOURNAL_VOLUME
(
DocumentID
int
Number
int
JournalID
int
VolEditorID
int
Unique key
Primary key
Foreign key
(DocumentID)
Foreign key
(JournalID)
Foreign Key
(VolEditorID)
unsigned
unsigned
unsigned
unsigned,
not null unique,
not null,
not null,
(JournalID, Number),
(DocumentID),
(DocumentID)
references DOCUMENT_TITLE
(JournalID)
on update cascade
on delete restrict,
References JOURNAL
(VolEditorID)
on update cascade
on delete restrict,
References VOLUME_EDITOR
on update cascade
on delete restrict
);
create table JOURNAL_EDITED_BY
(
EditorID
int unsigned
JournalID
int unsigned
Primary key
12/11/2007
not null,
not null,
(EditorID, JournalID),
Implementation & Problems
21
Foreign key
(EditorID)
Foreign key
(JournalID)
(EditorID)
References JOURNAL_EDITOR
(JournalID)
on update cascade
on delete restrict,
References JOURNAL
on update cascade
on delete restrict
);
create table CONFERENCE_PROCEEDINGS
(
DocumentID
int unsigned
ConfDate
date
AddrNumber
int
AddrStreet
varchar(30)
AddrCity
varchar(30)
AddrState
char(2)
AddrZip
char(5)
PChairNamePrefix char(3)
PChairNameFirst
varchar(15)
PChairNameMiddle varchar(15),
PChairNameLast
varchar(15)
not
not
not
not
not
not
not
not
not
Primary key
Foreign key
(DocumentID)
references DOCUMENT_TITLE
(DocumentID),
(DocumentID)
null unique,
null,
null,
null,
null,
null,
null,
null,
null,
not null,
on update cascade
on delete restrict
);
Show Tables;
# Done.
12/11/2007
Implementation & Problems
22
Appendix C – Interfacing Excel to MySQL
This appendix delineates the steps needed to interface Microsoft Excel 2003 (or later) to
MySQL 5.1 (or later) using the MySQL ODBC 3.51 Driver (mysql-connector-odbc3.51.21-win32.msi).
1.
Previously installed MySQL v5.1 database.
This appendix details the process by which Excel can be configured to communicate with
an instance of the MySQL database. It is presumed that the database has previously been
installed and configured. For details on the installation of MySQL 5.1, consult
“Appendix A - Installing & Configuring MySQL 5.1”.
2.
Previously defined schema Library and all the tables therein.
This appendix assumes that a database named “Library” has previously been created
within the MySQL RDBMS noted in section 1 of this appendix. The process for this is
discussed in “Appendix A - Installing & Configuring MySQL 5.1”. The sequence of
SQL commands required are shown in “Appendix B – Database Creation Script”.
The following general information describes the access criteria of the Library database
upon completion of all steps found in this appendix:
Stored Connection
Server Host
Port:
Username
Password
Default Schema
3.
<not defined>
localhost
3306
root
sun123
Library
Install the ODBC Connector
Get and install the mysql-connector-odbc-3.51.21-win32 connector. Comes in the form
of a Windows installer (mysql-connector-odbc-3.51.21-win32.msi), which can be doubleclicked on to install.
Elect to perform a typical installation. WARNING: Selecting custom or complete may
hide menu options which must be configured later on.
Approve the installation start and completion.
4.
Configure the ODBC Connector
Use the ODBC Management Tool to configure the ODBC Driver:
a. Invoke the ODBC Management Tool:
12/11/2007
Implementation & Problems
23
<Start><Settings><Control Panel><Administrative Tools>
<Data Sources (ODBC)>
b. In tab <User DSN>, click button <Add…>
c. Scroll through the driver names list and select “MySQL ODBC 3.51 Driver”.
Click <Finish>.
12/11/2007
Implementation & Problems
24
The ‘Add Data Source Name’ dialog box will appear.
d. Fill in requested fields:
 Data Source Name:
 Description:
 Server:
 User:
 Password:
 Database:
Library
<Any thing you Want>
localhost
root
sun123
Library
Click <Test> to test the connection. If connection to the database was successful,
the following dialog box will be seen.
Alternatively, can Click <Next> to advance to the <Connect Options> tab, from
which connection specific criteria may be entered. For example, the port number
may be specified. Note that the default port number for MySQL is 3306.
e. Select the <Connect Options> tab
f. Fill in the Port field:
 Port:
3306
 The default MySQL port.
g. Test the ODBC-MySQL connection:
Click the <Test Connection> button.
Click <OK> to exit
5.
Install MySQL Tools
Get and install the mysql-connector-odbc-3.51.21-win32 connector. Comes in the form
of a Windows installer (mysql-gui-tools-5.0-r12-win32.msi), which can be doubleclicked on to install.
Select a custom install and request only the following components:
 Common Components
 MySQL Administrator
 MySQL Query Browser
Default location for tools: C:\Program Files\ MySQL\MySQL Tools for 5.0\
12/11/2007
Implementation & Problems
25
6.
Test tools:
The following tools are available:
 MySQLAdministrator.exe
 MySQLQueryBrowser.exe
 MySQLSystemTrayMonitor.exe
Configure databases & tables.
Browse tables and change them.
Monitor database. Start & stop.
C:\Program Files\MySQL\MySQL Tools for 5.0>MySQLQueryBrowser.exe
Figure x – Launching the MySQL Query Browser
(Password is “sun123”)
7.
Creating a Trial Interface between Excel and MySQL for Access to the Library
Database

Enable resolution of object of type “ADODB”:
In Excel:
<Tools><References…>
Select <Microsoft ActiveX Data Objects 2.8 Library>
<OK>

Enable resolution of “Microsoft.Data.ODBC”:
In Excel:
<Tools><References…>
Select <Microsoft ActiveX Data Objects Recordset 2.8 Library>
<OK>
12/11/2007
Implementation & Problems
26

Provide missing reference to Microsoft.Data.ODBC.dll. The ODBC manage
provider isn't in MDAC. Instead it is an extra add in that can be downloaded
from:
http://msdn.microsoft.com/downloads/default.asp?url=/code/sample.asp?u
rl=/msdn-files/027/001/668/msdncompositedoc.xml&frame=true
-Done-
12/11/2007
Implementation & Problems
27
Download