introduction
DESCRIPTION
Introduction. Tutorial How to publish the contents of a database using features available in Microsoft Windows Local machine Legacy client/server Intranet/Internet. Introduction. “Might be a little bit heavy on the VB/ HTML side for old-time capacity planners...” Vic Soder, CMG ERB - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/1.jpg)
Reset
Member: Folder:
Member System in Library d:\PDB\ Beginning Thursday, November 02, 2000
PCTRGQTA PCTDPCTM PCTINTTM PCTPRVTM PCTCPUTM PCTUSRTM ALIGFIXU CNTXTSWT15.71 0.845 0.331 6.189 19.672 13.485 0. 391.76115.71 0.389 0.169 3.656 11.709 8.053 0. 222.26815.71 0.367 0.168 3.704 12.458 8.752 0. 248.41715.71 0.273 0.127 2.637 8.585 5.947 0. 189.7215.71 0.35 0.139 3.223 11.723 8.5 0. 215.09315.71 0.395 0.146 3.423 10.739 7.315 0. 226.97215.71 0.563 0.205 4.357 13.092 8.735 0. 267.9615.71 0.929 0.311 6.579 19.929 13.352 0. 361.801
15.822 1.197 0.402 10.362 29.489 19.128 0. 459.92916.38 1.419 0.482 28.815 53.956 25.141 0. 523.81416.38 1.272 0.43 12.282 33.391 21.107 0. 484.00316.38 1.303 0.452 12.243 34.578 22.335 0. 508.45616.38 1.262 0.438 11.22 32.047 20.827 0. 492.237
I J K L M N O P123456789
1011121314
0.
0.5
1.
1.5
Series
![Page 2: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/2.jpg)
Introduction
Tutorial
How to publish the contents of a database using features available in Microsoft Windows
Local machineLegacy client/server Intranet/Internet
![Page 3: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/3.jpg)
Introduction
“Might be a little bit heavy on the VB/ HTML side for old-time capacity planners...”
Vic Soder, CMG ERB
If you have ever written a COBOL program, you are overqualified for web development.
![Page 4: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/4.jpg)
Disclaimer
All products mentioned are the property of their owners
It may possible to use these technologies to publish data in ways that were not intended, or that have licensing implications
![Page 5: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/5.jpg)
Agenda
ScriptingData Access Methods Overview Configuration Issues Sample Scripts
ActiveX Controls Overview Sample Scripts Office Web Components
![Page 6: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/6.jpg)
Scripting
![Page 7: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/7.jpg)
Scripting
Script is the glue
Vbscript and Jscript
Legacy WindowsWSH – Windows Scripting Host
BrowserClient-side and Server-side
![Page 8: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/8.jpg)
Scripting
SAS
SQLServer
AccessWindow
BrowserMDAC
Script
ACTIVEX
![Page 9: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/9.jpg)
MDAC
Microsoft Data Access Components
![Page 10: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/10.jpg)
MDAC
Universal Data Access
1) ODBC – Open Database Connectivity
2) OLE DB – OLE Database
3) ADO – Active Data Objects
4) RDS – Remote Data Services
5) ADO.Net - ???
![Page 11: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/11.jpg)
MDAC
Non-SQL DB
SQL-aware Database
ODBC
OLE DB
ADO
Application
MS ODBCProvider
![Page 12: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/12.jpg)
ODBC
Circa 1990
Ubiquitous drivers
Not an Object-Oriented API
Relational bias
![Page 13: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/13.jpg)
OLE DB
COM interface
Support for broader spectrum of data repositories
Interface used by ADO
ODBC data sources accessible via “MS OLE DB provider for ODBC” Possibly with reduced function
![Page 14: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/14.jpg)
ADO
(currently) Highest level interface
Simplified object structure
Relies on OLE DB
![Page 15: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/15.jpg)
RDS
Makes ADO data sources accessible across a network
HTTP, HTTPS, or DCOM
Uses Microsoft Internet Information Server as conduit
![Page 16: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/16.jpg)
RDS
IIS
OLE DB Provider
ODBC Driver
Database
Application
ADO
RequestingProcess
HTTP
ServingProcess
![Page 17: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/17.jpg)
MDAC Configuration Issues
![Page 18: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/18.jpg)
ODBC Data Sources
Control PanelAdministrative Tools
Data Sources (ODBC)
SAS ODBC Drivers System Data Source TCP Port
c:\WINNT\system32\drivers\etc\services
![Page 19: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/19.jpg)
SAS TCP Port
![Page 20: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/20.jpg)
SAS ODBC vs. OLE DB
ODBC
Separate install
Full SQL support
Runs Proc OdbcServ instance
Field name is variable label
OLE DB
Auto install with V8
SQL not supported
Direct lib/member access
Field name is variable name
![Page 21: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/21.jpg)
MSDFMAP.ini
RDS Security
C:\WinNT\System\MSDFMAP.ini
Create token to identify local data source for remote access
Determine permitted access
![Page 22: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/22.jpg)
MSDFMAP.ini
![Page 23: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/23.jpg)
MSDFMAP.ini
[connect default]Access=NoAccess[sql default];Sql=" “ ' <---comment this line out[connect PDB]Access=ReadOnlyConnect="Provider=sas.LocalProvider.1;
Data Source=d:\PDB\Detail\“[connect SasRemote]Access=ReadOnlyConnect="Data Source=SasLocal"
![Page 24: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/24.jpg)
Other RDS/IIS Issues
IIS uses IWAM-servername as proxy (Launch IIS Process Account)
WQExxxxx.TRC diagnostics
Recommendations (SAS) ODBC – Start Proc OdbcServ manually OLE DB – give IWAM-servername read
permission to PDB
![Page 25: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/25.jpg)
MDAC Interfaces
![Page 26: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/26.jpg)
ADO Objects
Connection RecordSet
Fields
Command
ParametersErrors
Properties
![Page 27: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/27.jpg)
RecordSet Object
Set rs = CreateObject(“ADODB.Recordset”)
Methods rs.Open, rs.Close rs.MoveFirst, Rs.MoveNext
Properties rs.BOF, rs.EOF rs.Connection
![Page 28: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/28.jpg)
Field Object
Fields collection contains Field objects, one for each column in the table
rs.Fields.Count – number of columns
rs.Fields(x).Value - value
rs.Fields(x).Name – label
![Page 29: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/29.jpg)
Warning
Code to Follow
![Page 30: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/30.jpg)
ADO Script - WSH
Set rs = CreateObject(“ADODB.Recordset”)ConnectionString = “DSN=SasLocal”Sql = “Select PCTCPUTM from PDB.System”rs.Open Sql, ConnectionStringWhile Not rs.EOF
Msg = Msg + CStr(rs.Fields(0).Value) + vbCrLfrs.MoveNextend
MsgBox MsgD:\Cmg2000\AdoWsh.
vbs
![Page 31: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/31.jpg)
RDS Script - WSH
Set rs = CreateObject("ADODB.Recordset")ConnectionString = “Provider=MS Remote;” + _“Remote Server=http://ServerName;” + _“Handler=MSDFMAP.Handler;”+ _“Data Source=SasRemote” Sql = “Select PCTCPUTM from PDB.System“rs.Open Sql, ConnectionStringWhile Not rs.EOF
Msg = Msg + CStr(rs.Fields(0).Value) + vbCrLfrs.MoveNextend
MsgBox Msg D:\Cmg2000\RdsWsh.vbs
![Page 32: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/32.jpg)
ADO Script – Client-Side
<HTML><SCRIPT LANGUAGE=vbscript>Set rs = CreateObject("ADODB.Recordset")ConnectionString = "DSN=SasLocal“Sql = “Select PCTCPUTM from PDB.System“rs.Open Sql, ConnectionStringWhile Not rs.EOF
Msg = Msg + rs.Fields(0).Value + vbCrLfrs.MoveNextend
MsgBox Msg</SCRIPT></HTML> D:\Cmg2000\AdoClient.htm
![Page 33: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/33.jpg)
ADO Script – Server-Side
<HTML><%Set rs = CreateObject("ADODB.Recordset")ConnectionString = "Data Source=SasLocal“Sql = "Select PCTCPUTM from PDB.System“rs.Open Sql, ConnectionStringResponse.Write("<SELECT>" + vbCrLf)While Not rs.EOF str = "<OPTION>" + CStr(rs.Fields(0).Value) + vbCrLf Response.Write(str) rs.MoveNextWend http://.../AdoServer.asp%> </OPTION></SELECT> </HTML>
![Page 34: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/34.jpg)
ADO Script Options
Access Type Script Method Access Method
Local Machine WSH orClient-Side
Any
Client / Server WSH orClient-Side
RDS orOLE DB
Intranet UNC Accessible
Client-Side RDS orOLE DB
Internet Server-Side Any
![Page 35: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/35.jpg)
ActiveX Objects
![Page 36: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/36.jpg)
ActiveX Objects
COM subroutinesVisible and notMicrosoft and notProgId (OWC.Spreadsheet) or ClassId“0002E510-0000-0000-C000-000000000046” Create them Read/write properties Call methods Handle events
![Page 37: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/37.jpg)
Submit
Member: Folder:
Member System in Library d:\PDB\ Beginning Thursday, November 02, 2000
A B C D E F G H123456789
1011121314
![Page 38: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/38.jpg)
ActiveX – No Script
<HTML><OBJECT HEIGHT=500 WIDTH=100%classid=clsid:C4D2D8E0-D1DD-11CE-940F-008029004347></OBJECT></HTML>
D:\Cmg2000\NoScript.htm
![Page 39: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/39.jpg)
ActiveX – Data Bound
<HTML><OBJECT id=grid height=600 width=100%classid=clsid:0ECD9B64-23AA-11D0-B351-00A0C9055D8E></OBJECT><SCRIPT LANGUAGE=vbscript>Set rs = CreateObject("ADODB.Recordset")Set cn = CreateObject("ADODB.Connection")cn.Open "Provider=sas.LocalProvider.1;Data Source=d:\PDB\“rs.Open “System", cn, , , 512 'adCmdTableDirectset grid.DataSource = rs</SCRIPT></HTML> D:\Cmg2000\DataBound.htm
![Page 40: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/40.jpg)
Microsoft Office Web Components
![Page 41: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/41.jpg)
Office Web Components
Ship with Office 2000c:\Program Files\MicrosoftOffice\Office\MsOwc.dll
Spreadsheet clsid:0002E510-0000-0000-C000-000000000046 ProgId = OWC.Spreadsheet
Chart clsid:0002E500-0000-0000-C000-000000000046 ProgId = OWC.Chart
Pivot Table - OWC.PivotTableDSC - OWC.DataSourceControl
![Page 42: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/42.jpg)
OWC Spreadsheet
Resembles Excel spreadsheet
Visible or not
Contains one or more Worksheets
Worksheets contain cells spreadsheet.worksheet.Cell(row,col) Single Worksheet then
spreadsheet.Cell(row,col)
![Page 43: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/43.jpg)
OWC Spreadsheet Range
Identifies a rectangular group of cells
Used by methods that operate on groups of cells set Range = spreadsheet.Columns(x) object.Range(TopLeft : BottomRight)
![Page 44: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/44.jpg)
OWC Spreadsheet API
ss.ActiveSheet.UsedRange.Clear
ss.ViewableRange = ss.ActiveSheet.UsedRange.Address
ExcelStyleCellReference = ss.Columns(Columns).Address
Set c = ss.ConstantsConstants available at run-time
![Page 45: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/45.jpg)
OWC Spreadsheet Formatting
ss.TitleBar.Caption = “string"
ss.Columns.ColumnWidth = 100
ss.Rows(x).Font.Bold = True
range.NumberFormat = "hh:mm“
ss.Columns(x).Hidden = True
ss.DisplayRowHeaders = False
ss.ScreenUpdating = False
![Page 46: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/46.jpg)
Populate Spreadsheetfrom RecordSet
Row = 1While Not rs.EOF Col = 1 While Col <= rs.Fields.Count ss.ActiveSheet.Cells(Row, Col).Value =
rs.Fields(Col - 1).Value Col = Col + 1 Wend Row = Row + 1 rs.MoveNextWend
![Page 47: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/47.jpg)
Populate Faster
Set field = rs.FieldsSet cell = ss.ActiveSheet.CellsRow = 1While Not rs.EOF Col = 1 While Col <= rs.Fields.Count cell(Row, Col).Value = field(Col - 1).Name Col = Col + 1 Wend Row = Row + 1 rs.MoveNextWend
![Page 48: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/48.jpg)
OWC Chart
General purpose charting functions 45 chart types
ChartSpace - one or more charts
Careful with terminology Series – points to be plotted as a group Value axis is vertical (y) Category axis is horizontal (x)
![Page 49: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/49.jpg)
Chart Types
ColumnBar Line Pie Scatter Bubble Area Doughnut RadarStockPolar
ClusteredStacked Stacked100MarkersSmooth ExplodedFilledHLC OHLCCombo
![Page 50: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/50.jpg)
OWC Chart API
Set cs.DataSource = ss.ObjectChart data will come from spreadsheet
Set chart = cs.Charts.Add()Add a chart to the chart space
cs.ClearClear all charts in the chart space
Set c = cs.ConstantsConstants available at run-time
![Page 51: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/51.jpg)
OWC Chart - Formatting
chart.Type = c.chChartTypeLine Basic chart type – 46 varieties
chart.HasLegend = TrueChart will have legend
chart.HasTitle = TrueChart will have title
chart.Title.Caption = “C1”Take title from cell C1 in spreadsheet
![Page 52: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/52.jpg)
OWC Chart - SetData
Method used to identify series1) Dimension or attribute of chart2) Data source3) Data Reference
chart.SetData c.chDimSeriesNames, 0, “A2“Variable name that will appear in legend
chart.SetData c.chDimValues, 0, “C2:C4“Cells containing value (y) axis data
pointschart.SetData c.chDimCategories, 0, “B2:B4”
Cells with category (x) axis data points
![Page 53: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/53.jpg)
OWC Chart Series
0
5
10
15
20
25
30
1:00 2:00 3:00
InetInfo
![Page 54: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/54.jpg)
OWC Chart Series
A B C
1 Process StarTime PctCpuTm
2 InetInfo 01:00 30
3 InetInfo 02:00 20
4 InetInfo 03:00 25
![Page 55: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/55.jpg)
Chart from Spreadsheet
set cs.DataSource = ss.ObjectSet chart = cs.Charts.Add()Set c = cs.Constantschart.Type = c. chChartTypeColumnClusteredchart.HasLegend = Truechart.SetData c.chDimSeriesNames, 0, “A2“chart.SetData c.chDimValues, 0, “C2:C4“chart.SetData c.chDimCategories, 0, “B2:B4"
![Page 56: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/56.jpg)
References
Programming Microsoft Office 2000 Web Components
By Dave Stearns
Microsoft Press
![Page 57: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/57.jpg)
References
SAS ODBC User’s Guide and Programmer’s Reference, SAS InstituteMicrosoft Developer Network Library (MSDN) Microsoft TechNetMSNews.Microsoft.com newsgroups
Public.Data.ADO.RDS Public.Office.Developer.Web.Components
http://www.Able-Consulting.com/
![Page 58: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/58.jpg)
SasToOwc.htm – Sample App
D:\Cmg2000\SasToOwc.htm
![Page 59: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/59.jpg)
Issues
Much of this is Windows-only technolgy
Un-terminated character strings when accessing SAS ODBC data sources through RDS
![Page 60: Introduction](https://reader035.vdocuments.us/reader035/viewer/2022062308/56812b04550346895d8ee69b/html5/thumbnails/60.jpg)
Summary