odbc the middleware that connects!
DESCRIPTION
ODBC the MIDDLEWARE that CONNECTS!. Presented by Carter-Davis-Wagner CSIS 4490 - Spring 2002 Dr. Hoganson. Conceptual Office Layout at Bob’s Bikes. PC at front counter. Server in back office. PC at loading dock. LAN. PC in Bob’s office. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/1.jpg)
ODBCODBC thethe
MIDDLEWAREMIDDLEWARE thatthat
CONNECTS!CONNECTS!
Presented byCarter-Davis-WagnerCSIS 4490 - Spring 2002 Dr. Hoganson
![Page 2: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/2.jpg)
Conceptual Office Layout at Bob’s Bikes
PC at front counter
PC at loading dock
PC in Bob’s office
Server in back office
LAN
![Page 3: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/3.jpg)
How does it connect?
Clients
LAN Server(s)
FirewallInternet
ODBC layer
ODBC - Open DataBase Connectivity - from Microsoft
•Provides interface•Provides interface to MySQL Database to access the tables for Bob’s Bike Shop using ActiveX
•Interfaces with Word to create form letters with MSQuery
•Interfaces with Excel to extract data to create charts and graphs using VBA
•Also may interface with
•PowerPoint
•Access Database
•Products from other Vendors
![Page 4: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/4.jpg)
Bob’s Bike Shop Inventory SystemSpecifications
Server Client 1 P100 server IBM ThinkPad 48MB RAM Windows 95 SCSI Hard Drive Windows NT 4.0 Workstation Client 2 DHCP Addressing IBM ThinkPad Windows 2000 ProfessionalHub 3Com Model TP4 Database 4 Ports MySQL http://www.mysql.org MySQL ODBC Driver Cable Category 5 Software Visual Basic MS Excel MS Word
![Page 5: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/5.jpg)
ODBC Configuration
MySQL has a click and go setup program to install ODBC Drivers
Configure the drivers to access the data
•Data Set Name•Location (IP address or server name)•Database name•User ID and password (as required)
![Page 6: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/6.jpg)
Select the MySQL ODBC Driver...
![Page 7: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/7.jpg)
MySQL
Configuration screen for the ODBC driver
![Page 8: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/8.jpg)
MySQL
Database Administratio
nScreen
![Page 9: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/9.jpg)
MySQL Manager
Database csis4490 has 2 Tables•Manufacturer•Inventory
![Page 10: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/10.jpg)
The Database The Database Interface...Interface...
![Page 11: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/11.jpg)
Table Statements
use csis4490;
create table inventory (model char(10) Not Null, color char(10) Not Null, size int(11) Not Null Default 0, gender char(1) Not Null, instock int(11) Default 0, onorder int(1) Not Null, manid int(9) Not Null Default 0, invid int(9) Not Null Auto_Increment,Primary Key (invid), Unique id (invid),FOREIGN KEY(manid) REFERENCES manufacturer(manid) )
create table manufacturer (company char(25) Not Null, address1 char(25) Not Null, address2 char(25),city char(15) Not Null, state char(12) , country char(12) Not Null, mailcode char(12), contact char(25), phone char(12), email char(30),manid int(9) Not Null Auto_Increment, Primary Key (manid), Unique id (manid) )
![Page 12: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/12.jpg)
MySQL QueryMySQL Query
Select * from inventory
![Page 13: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/13.jpg)
Word: Mail Merge using MSQuery to create a form letter
![Page 14: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/14.jpg)
Word: Mail Merge using MSQuery to create a form letter
![Page 15: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/15.jpg)
Word: Fields that are extracted from the database
The fields in << >> are extracted from the database for use in the form letter.
![Page 16: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/16.jpg)
Word: Completed letter with name and address!
![Page 17: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/17.jpg)
Excel: Data can be extracted to spreadsheet using MSQuery
![Page 18: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/18.jpg)
Excel: Data can be also be accessed using code (VBA).
‘select DSNconString = "DSN=csis4490"‘connectthisconn = SQLOpen(conString, , 2)If IsError(thisconn) Then Error 9999 'invalid response from servermysql$ = "select model, color, size, instock from inventory"'send querySheets("Status").Range("b4") = sqlexecquery(thisconn, StringToArray(mysql$))‘save error (if any)Sheets("Status").Range("b17") = sqlerror()‘define destination cell for each field retrievedSheets("Status").Range("b5") = sqlbind(thisconn, 1, Sheets("Data").Range("a6"))Sheets("Status").Range("b19") = sqlerror()Sheets("Status").Range("c5") = sqlbind(thisconn, 2, Sheets("Data").Range("b6"))Sheets("Status").Range("b21") = sqlerror()
![Page 19: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/19.jpg)
Excel: Generate chart from the database.
![Page 20: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/20.jpg)
ODBC Troubleshooting…
![Page 21: ODBC the MIDDLEWARE that CONNECTS!](https://reader035.vdocuments.mx/reader035/viewer/2022062409/56814590550346895db27e2b/html5/thumbnails/21.jpg)
Thank you !