Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Smart data-binding

0 views
Skip to first unread message

Guralnik

unread,
Dec 24, 1999, 3:00:00 AM12/24/99
to
Hi everybody!
 
One would suppose that delivering structured data to the web requires more than just a basic knowledge in three areas at the very least:
 1) html/dhtml and all web-related stuff, 
 2) working with databases,
 3) integrating the two.
Since I'm a complete newbie to the last two, I'd really like to hear your ideas/advice on the following subject:
 
Currently I have a "flat" Comma Separated table generated from Excel, that I data-bind using a TDC to an HTML table. Looks somewhat like this:
 
Keyword   Type        Description             Subtype
 Sine      function    Text with links         ...
 Cosine    function    More text with links    ...
 triangle  shape       Explanation             ...
 x+y=5     equation    etc...                  ...
 
Unfortunately, this is a very restricted "flat" data representation, and what I'd really like to do is to create a "flexible" hierarchy, something like a multi-relational database. For example, if the user wants to see this database "nested" by type, he'll get:
Type         Description             Subtype
+ function  
 -- Sine       Text with links         ...
 -- Cosine     More text with links    ...
+ shape
 -- triangle   Explanation             ...
 
Same thing if he wants it nested by a sub-type, alphabetical order etc.
 
Now, the question is, can the data-binding technique of TOC/RDS(?) do it? I've seen lots of "collapsing lists" scripts on the net, but they were never data-bound, moreover, I can't think of an easy way to implementing it, at least with TDC. Do you happen to know of any good way of implementing this, whatever structured data technology it uses? I know that this data slicing and hierarchy re-building can be done with SQL, but I have no idea of how it can be combined with dhtml.
 
Any ideas, suggestions or just general thoughts will be really appreciated,
 
Thanks again for your help,
Benjamin
 
PS Please reply by email, in addition to posting to the newsgroup

Mark Rogers, MVP

unread,
Dec 24, 1999, 3:00:00 AM12/24/99
to
Hi Benjamin,

Assuming you can use ASP... You need to add the DHTML tags when you create
the page from your data. Here's some good places to start.
http://www.learnasp.com/
http://www.takempis.com
--
Mark Rogers
Microsoft MVP

_______________ Please Send Replies to Newsgroup ______________
NG Rules: http://support.microsoft.com/support/news/rules.asp

SiteCrafters Internet Services - Whitefish, Montana
Web Site Development & Hosting http://www.SiteCrafters.com
FrontPage & Web Author Help http://www.SiteCrafters.com/support

Guralnik <gura...@bezeqint.net> wrote in message
news:ODCn8OkT$GA.265@cppssbbsa04...

Thomas A. Rowe

unread,
Dec 24, 1999, 3:00:00 AM12/24/99
to
Convert to an Access Database and then look into ASP/VBScripting, to access and display.

--
=====================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)
http://www.ycoln-resources.com
FrontPage Resources, Email Discussion List,
Newsletter, WebRing, MS KB Quick Links, etc.
 

Kevin Spencer

unread,
Dec 24, 1999, 3:00:00 AM12/24/99
to
Well, actually it's not necessary to convert to Access. ODBC does come with
a text driver, as well as an Excel driver.

For more on ASP/ADO to connect with data sources, visit
http://www.takempis.com.

HTH,

--
Kevin Spencer
Microsoft FrontPage MVP
Site Design by TAKempis
Internet Database Application Programming with ASP/ADO
http://www.takempis.com
Internet Database Development with Microsoft Technologies
ASP Discussion Web Available!

"Thomas A. Rowe" <tar...@noln.com> wrote in message
news:Ovy7VTkT$GA.270@cppssbbsa04...

Justin Rogers

unread,
Dec 24, 1999, 3:00:00 AM12/24/99
to
Well,
 
    You can implement the nested representation by using what I call Pseudo Data binding.  I do this
quite often in my apps as Internet Explorer event firing doesn't work worth a darn, and formatting
of currency/sorting of currency doesn't work, and I have instances where I want to convert a value
from the database into different display values.  So what I do is iterate through the recordset and
build the table dynamically myself.  This is the same thing that a TDC does.  And the source code for
a TDC is available from Microsoft if you want to write your own TDC using C++.
 
    I have been using JavaScript HTC's to perform my formatting and display, and it works quite
quickly and nicely.  Basic steps follow:
 
    1.  Store the DataFld and DataSrc internally
    2. Unbind the table by setting DataSrc = ''
    3.  Use window.document.{dsname}.recordset, Filter, and SortBy properties to create your structure
    4.  Spit out your structure by adding rows and columns.
 
    If you are readily familiar with DHTML then you can easily accomplish this task and it is much better
to do the stuff on the client side if you don't have IIS or another scriptable Server backend to work off
of.
 
    - Justin Rogers, CEO DigiTec Web Consultants

Trevor Dwyer

unread,
Dec 27, 1999, 3:00:00 AM12/27/99
to

You should consider using SQL Server and XML. The information on getting SQL
Server to render XML direct from the database called be found at the
following url:

http://msdn.microsoft.com/workshop/xml/articles/xmlsql/sqlxml_prev.asp

Use can use the following example to create the hierarchy required.

[xml_hierarchical.html]
<HTML>
<HEAD>
<TITLE>Tabular Hierarchical Record Binding using XML</TITLE>
<STYLE TYPE="text/css">
TABLE {border-style:solid; border-width:thin}
.heading {border-color:gray; text-align:left}
.parent {border-color:darkgray; width:100%}
.child {border-color:white}
TR {}
.heading {background-color:gray; width:100%}
.parent {background-color:darkgray; font-weight:bold; width:100%}
.child {background-color:white; width:100%}
TD {}
.Expand {font-family:courier; WIDTH:1%; cursor:hand}
.Space {font-family:courier; WIDTH:1%}
</STYLE>
</HEAD>
<BODY>

<XML ID="dsoPublishers" SRC="XMLHierMultiChild.xml">
</XML>

<TABLE ID="tblPublishers" DATASRC="#dsoPublishers" CLASS="heading">
<THEAD CLASS="heading">
<TR ID="HeadingRow">
<TH STYLE="WIDTH:1%">&nbsp;</TH>
<TH STYLE="WIDTH:39%">Publisher</TH>
<TH STYLE="WIDTH:15%">City</TH>
<TH STYLE="WIDTH:5%">State</TH>
</TR>
</THEAD>
<TBODY>
<TR>
<TD ID="TitlesEmployees" CLASS="Expand">+</TD>
<TD ID="pub_name" STYLE="WIDTH:39%"><DIV DATAFLD="pub_name"></DIV></TD>
<TD STYLE="WIDTH:15%"><DIV DATAFLD="city"></DIV></TD>
<TD STYLE="WIDTH:5%"><DIV DATAFLD="state"></DIV></TD>
</TR>
<TR>
<TD CLASS="space">
<DIV STYLE="display:none">&nbsp;</DIV>
</TD>
<TD COLSPAN=3>
<DIV ID="tblTitlesEmployees" STYLE="display:none">
<TABLE CLASS="parent">
<TR>
<TD ID="Titles" CLASS="Expand">+</TD>
<TD>Titles</TD>
</TR>
<TR>
<TD CLASS="space">
<DIV STYLE="display:none">&nbsp;</DIV>
</TD>
<TD COLSPAN=4>
<DIV ID="tblTitles" STYLE="display:none">
<TABLE DATASRC="#dsoPublishers" DATAFLD="Title" CLASS="child">
<TR>
<TD ID="Sales" CLASS="Expand">+</TD>
<TD STYLE="width:20%"><DIV DATAFLD="title"></DIV></TD>
<TD STYLE="width:10%"><DIV DATAFLD="price"></DIV></TD>
</TR>
<TR>
<TD CLASS="space">
<DIV STYLE="display:none">&nbsp;</DIV>
</TD>
<TD COLSPAN=3>
<DIV ID="tblSales" STYLE="display:none">
<TABLE DATASRC="#dsoPublishers" DATAFLD="sale" CLASS="child">
<TR>
<TD STYLE="width:10%"><DIV DATAFLD="ord_date"></DIV></TD>
<TD STYLE="width:20%"><DIV DATAFLD="qty"></DIV></TD>
</TR>
</TABLE>
</DIV>
</TD>
</TR>
</TABLE>
</DIV>
</TD>
</TR>
<TR>
<TD ID="Employees" CLASS="Expand">+</TD>
<TD>Employees</TD>
</TR>
<TR>
<TD COLSPAN=4>
<DIV ID="tblEmployees" STYLE="display:none">
<TABLE DATASRC="#dsoPublishers" DATAFLD="Employee" CLASS="child">
<TR>
<TD CLASS="space">&nbsp;</TD>
<TD><DIV DATAFLD="fname"></DIV></TD>
<TD><DIV DATAFLD="lname"></DIV></TD>
</TR>
</TABLE>
</DIV>
</TD>
</TR>
</TABLE>
</DIV>
</TD>
</TR>
</TBODY>
</TABLE>

<SCRIPT LANGUAGE=JavaScript FOR=TitlesEmployees EVENT=onclick>

rowID = this.recordNumber - 1;

if (tblTitlesEmployees[rowID].style.display == "none")
{
TitlesEmployees[rowID].innerText = "-";
tblTitlesEmployees[rowID].style.display = "inline";
}
else
{
TitlesEmployees[rowID].innerText = "+";
tblTitlesEmployees[rowID].style.display = "none";
}

window.event.cancelBubble = true;

</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=Titles EVENT=onclick>

rowID = this.recordNumber - 1;

if (tblTitles[rowID].style.display == "none")
{
Titles[rowID].innerText = "-";
tblTitles[rowID].style.display = "inline";
}
else
{
Titles[rowID].innerText = "+";
tblTitles[rowID].style.display = "none";
}

window.event.cancelBubble = true;

</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=Employees EVENT=onclick>

rowID = this.recordNumber - 1;

if (tblEmployees[rowID].style.display == "none")
{
Employees[rowID].innerText = "-";
tblEmployees[rowID].style.display = "inline";
}
else
{
Employees[rowID].innerText = "+";
tblEmployees[rowID].style.display = "none";
}

window.event.cancelBubble = true;

</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=Sales EVENT=onclick>

rowID = this.recordNumber - 1;

if (tblSales[rowID].style.display == "none")
{
Sales[rowID].innerText = "-";
tblSales[rowID].style.display = "inline";
}
else
{
Sales[rowID].innerText = "+";
tblSales[rowID].style.display = "none";
}

window.event.cancelBubble = true;

</SCRIPT>
</BODY>
</HTML>

[XMLHierMultiChild.xml]
<?xml version="1.0"?>
<Publishers>
<Publisher>
<pub_id>0736</pub_id>
<pub_name>New Moon Books</pub_name>
<city>Boston</city>
<state>MA</state>
<country>USA</country>
<title>
<title_id>BU2075</title_id>
<title>You Can Combat Computer Stress!</title>
<type>business </type>
<pub_id>0736</pub_id>
<price>$2.99</price>
<advance>$10,125.00</advance>
<royalty>24</royalty>
<ytd_sales>18,722</ytd_sales>
<notes>The latest medical and psychological techniques for living
with the electronic office. Easy-to-understand explanations.</notes>
<pubdate>6/30/91</pubdate>
<sale>
<stor_id>7896</stor_id>
<ord_num>X999</ord_num>
<ord_date>2/21/93</ord_date>
<qty>35</qty>
<payterms>ON invoice</payterms>
<title_id>BU2075</title_id>
</sale>
</title>
<title>
<title_id>PS7777</title_id>
<title>Emotional Security: A New Algorithm</title>
<type>psychology </type>
<pub_id>0736</pub_id>
<price>$7.99</price>
<advance>$4,000.00</advance>
<royalty>10</royalty>
<ytd_sales>3,336</ytd_sales>
<notes>Protecting yourself and your loved ones from undue
emotional stress in the modern world. Use of computer and nutritional aids
emphasized.</notes>
<pubdate>6/12/91</pubdate>
<sale>
<stor_id>7131</stor_id>
<ord_num>P3087a</ord_num>
<ord_date>5/29/93</ord_date>
<qty>25</qty>
<payterms>Net 60</payterms>
<title_id>PS7777</title_id>
</sale>
</title>
<employee>
<emp_id>PDI47470M</emp_id>
<fname>Palle</fname>
<minit>D</minit>
<lname>Ibsen</lname>
<job_id>7</job_id>
<job_lvl>195</job_lvl>
<pub_id>0736</pub_id>
<hire_date>5/9/93</hire_date>
</employee>
<employee>
<emp_id>TPO55093M</emp_id>
<fname>Timothy</fname>
<minit>P</minit>
<lname>O'Rourke</lname>
<job_id>13</job_id>
<job_lvl>100</job_lvl>
<pub_id>0736</pub_id>
<hire_date>6/19/88</hire_date>
</employee>
</Publisher>
<Publisher>
<pub_id>0877</pub_id>
<pub_name>Binnet and Hardley</pub_name>
<city>Washington</city>
<state>DC</state>
<country>USA</country>
<title>
<title_id>MC2222</title_id>
<title>Silicon Valley Gastronomic Treats</title>
<type>mod_cook </type>
<pub_id>0877</pub_id>
<price>$19.99</price>
<advance>$0.00</advance>
<royalty>12</royalty>
<ytd_sales>2,032</ytd_sales>
<notes>Favorite recipes for quick, easy, and elegant meals.</notes>
<pubdate>6/9/91</pubdate>
<sale>
<stor_id>7896</stor_id>
<ord_num>TQ456</ord_num>
<ord_date>12/12/93</ord_date>
<qty>10</qty>
<payterms>Net 60</payterms>
<title_id>MC2222</title_id>
</sale>
</title>
<title>
<title_id>MC3021</title_id>
<title>The Gourmet Microwave</title>
<type>mod_cook </type>
<pub_id>0877</pub_id>
<price>$2.99</price>
<advance>$15,000.00</advance>
<royalty>24</royalty>
<ytd_sales>22,246</ytd_sales>
<notes>Traditional French gourmet recipes adapted for modern
microwave
cooking.</notes>
<pubdate>6/18/91</pubdate>
<sale>
<stor_id>7131</stor_id>
<ord_num>N914014</ord_num>
<ord_date>9/14/94</ord_date>
<qty>25</qty>
<payterms>Net 30</payterms>
<title_id>MC3021</title_id>
</sale>
<sale>
<stor_id>8042</stor_id>
<ord_num>423LL922</ord_num>
<ord_date>9/14/94</ord_date>
<qty>15</qty>
<payterms>ON invoice</payterms>
<title_id>MC3021</title_id>
</sale>
</title>
<title>
<title_id>MC3026</title_id>
<title>The Psychology of Computer Cooking</title>
<type>UNDECIDED </type>
<pub_id>0877</pub_id>
<price></price>
<advance></advance>
<royalty></royalty>
<ytd_sales></ytd_sales>
<notes></notes>
<pubdate>4/3/96 3:45:49 AM</pubdate>
</title>
<title>
<title_id>PS1372</title_id>
<title>Computer Phobic AND Non-Phobic Individuals: Behavior
Variations</title>
<type>psychology </type>
<pub_id>0877</pub_id>
<price>$21.59</price>
<advance>$7,000.00</advance>
<royalty>10</royalty>
<ytd_sales>375</ytd_sales>
<notes>A must for the specialist,
this book examines the difference between those who hate and fear computers
and those who
don't.</notes>
<pubdate>10/21/91</pubdate>
<sale>
<stor_id>7131</stor_id>
<ord_num>P3087a</ord_num>
<ord_date>5/29/93</ord_date>
<qty>20</qty>
<payterms>Net 60</payterms>
<title_id>PS1372</title_id>
</sale>
</title>
<title>
<title_id>TC3218</title_id>
<title>Onions, Leeks, and Garlic: Cooking Secrets of the
Mediterranean</title>
<type>trad_cook </type>
<pub_id>0877</pub_id>
<price>$20.95</price>
<advance>$7,000.00</advance>
<royalty>10</royalty>
<ytd_sales>375</ytd_sales>
<notes>Profusely illustrated in
color, this makes a wonderful gift book for a cuisine-oriented
friend.</notes>
<pubdate>10/21/91</pubdate>
<sale>
<stor_id>7067</stor_id>
<ord_num>P2121</ord_num>
<ord_date>6/15/92</ord_date>
<qty>40</qty>
<payterms>Net 30</payterms>
<title_id>TC3218</title_id>
</sale>
</title>
<title>
<title_id>TC4203</title_id>
<title>Fifty Years in Buckingham Palace Kitchens</title>
<type>trad_cook </type>
<pub_id>0877</pub_id>
<price>$11.95</price>
<advance>$4,000.00</advance>
<royalty>14</royalty>
<ytd_sales>15,096</ytd_sales>
<notes>More anecdotes from the Queen's favorite cook
describing life among English royalty. Recipes, techniques, tender
vignettes.</notes>
<pubdate>6/12/91</pubdate>
<sale>
<stor_id>7067</stor_id>
<ord_num>P2121</ord_num>
<ord_date>6/15/92</ord_date>
<qty>20</qty>
<payterms>Net 30</payterms>
<title_id>TC4203</title_id>
</sale>
</title>
<title>
<title_id>TC7777</title_id>
<title>Sushi, Anyone?</title>
<type>trad_cook </type>
<pub_id>0877</pub_id>
<price>$14.99</price>
<advance>$8,000.00</advance>
<royalty>10</royalty>
<ytd_sales>4,095</ytd_sales>
<notes>Detailed instructions on how to make authentic Japanese sushi
in your spare
time.</notes>
<pubdate>6/12/91</pubdate>
<sale>
<stor_id>7067</stor_id>
<ord_num>P2121</ord_num>
<ord_date>6/15/92</ord_date>
<qty>20</qty>
<payterms>Net 30</payterms>
<title_id>TC7777</title_id>
</sale>
</title>
<employee>
<emp_id>ENL44273F</emp_id>
<fname>Elizabeth</fname>
<minit>N</minit>
<lname>Lincoln</lname>
<job_id>14</job_id>
<job_lvl>35</job_lvl>
<pub_id>0877</pub_id>
<hire_date>7/24/90</hire_date>
</employee>
<employee>
<emp_id>M-R38834F</emp_id>
<fname>Martine</fname>
<minit> </minit>
<lname>Rance</lname>
<job_id>9</job_id>
<job_lvl>75</job_lvl>
<pub_id>0877</pub_id>
<hire_date>2/5/92</hire_date>
</employee>
<employee>
<emp_id>DBT39435M</emp_id>
<fname>Daniel</fname>
<minit>B</minit>
<lname>Tonini</lname>
<job_id>11</job_id>
<job_lvl>75</job_lvl>
<pub_id>0877</pub_id>
<hire_date>1/1/90</hire_date>
</employee>
</Publisher>
<Publisher>
<pub_id>1389</pub_id>
<pub_name>Algodata Infosystems</pub_name>
<city>Berkeley</city>
<state>CA</state>
<country>USA</country>
<title>
<title_id>BU1032</title_id>
<title>The Busy Executive's Database Guide</title>
<type>business </type>
<pub_id>1389</pub_id>
<price>$19.99</price>
<advance>$5,000.00</advance>
<royalty>10</royalty>
<ytd_sales>4,095</ytd_sales>
<notes>An overview of available database systems with
emphasis on common business applications. Illustrated.</notes>
<pubdate>6/12/91</pubdate>
<sale>
<stor_id>6380</stor_id>
<ord_num>6871</ord_num>
<ord_date>9/14/94</ord_date>
<qty>5</qty>
<payterms>Net 60</payterms>
<title_id>BU1032</title_id>
</sale>
<sale>
<stor_id>8042</stor_id>
<ord_num>423LL930</ord_num>
<ord_date>9/14/94</ord_date>
<qty>10</qty>
<payterms>ON invoice</payterms>
<title_id>BU1032</title_id>
</sale>
</title>
<title>
<title_id>PC9999</title_id>
<title>Net Etiquette</title>
<type>popular_comp</type>
<pub_id>1389</pub_id>
<price></price>
<advance></advance>
<royalty></royalty>
<ytd_sales></ytd_sales>
<notes>A must-read for computer conferencing.</notes>
<pubdate>4/3/96 3:45:49 AM</pubdate>
</title>
<employee>
<emp_id>SKO22412M</emp_id>
<fname>Sven</fname>
<minit>K</minit>
<lname>Ottlieb</lname>
<job_id>5</job_id>
<job_lvl>150</job_lvl>
<pub_id>1389</pub_id>
<hire_date>4/5/91</hire_date>
</employee>
</Publisher>
</Publishers>


Best Regards

Trevor Dwyer - SQL Server MVP
tdw...@email.msn.com

Guralnik <gura...@bezeqint.net> wrote in message
news:ODCn8OkT$GA.265@cppssbbsa04...

T-man

unread,
Jan 10, 2000, 3:00:00 AM1/10/00
to
Dang!--

just got a load of that crosspost, so briefly:

XML

T


"Guralnik" <gura...@bezeqint.net> wrote in message news:ODCn8OkT$GA.265@cppssbbsa04...

0 new messages