bind HTML table to ADO persisted recordset client-side

ADO

    Next

  • 1. referencing correct ADO/ADOX library
    I have an Access 2000/2002 application using ADO/ADOX 2.7 that is deployed to desktops within several different organizations. One won't upgrade from MDAC 2.5 to MDAC 2.7, so I need to make the app work with MDAC 2.5. I'd like to make it work more generally with all versions of ADO/ADOX since 2.1, or at least 2.5 (assuming a review doesn't reveal too much code using newer ADO/ADOX features). Can I programmatically check the version of MDAC installed and set appropriate references to it _after_ the application has loaded? We've had terrible experiences with install packs, and making one that would install different versions of the application based on checking the installed version of MDAC is not something I relish within the client's limited budget. Also, when developing, I notice that earlier versions of ADO are available as references on my development machine, but the same isn't true for ADOX. Is it possible to reference earlier versions of ADOX on a development machine, or do I have to set up a separate computer for this development and testing? Thanks in advance, Joe (cross-posted to access.activexcontrol)
  • 2. Server Side Cursors Not Working
    I have a Visual Basic 6 application tied to Access using ADO 2.7 which I am altering for use with a SQL Server database. However, there seems to be a problem with using Server side cursors to retrieve and update data, whereas if I change to client side cursors it works perfecly. When retrieving I can get a record count but the records can't seem to be displayed (in a text box, grid etc) and updates don't work at all. I have tried all the appropriate cursor and lock type combinations. Any help would be gratefully recieved as I can't seem to find any solution and need some Server side processing for performance reasons. Cheers, Chris.
  • 3. Replicating parts of an Access database
    Fredrik, Is it possible for you to split the database into two? Have one for all the small static tables, that you can copy easily due to it's small size; and have another database containing the single document table. Regards, Danny "Fredrik Olsson" < XXXX@XXXXX.COM > wrote in message news:0ed401c35cde$f37349e0$ XXXX@XXXXX.COM ... > My application is supposed to be able to make a copy of > the shared database as a local read only copy. This is > however not quite possible as the database has grown to > more then 1gig and will grow even more. > > The only table that takes space though is a table where > documents is stored. And for the local copy this table is > not needed. > > So is it possible to make a local copy of the database > without including a single table?

bind HTML table to ADO persisted recordset client-side

Postby Bruce Hensley » Fri, 30 Sep 2005 00:42:51 GMT

I've seen hints that it is possible to bind an HTML table to an ADO
recordset, but I can't find an example.

I would like to persist a disconnected recordset on the local client, then
open it (read-only) from DHTML and bind it to a table.  I want to use
recordset.sort and .filter to manipulate the display dynamically.

I can find info and examples on binding to XML data islands, TDC, and
others, but not just to a recordset.  Am I missing something?

Thanks,
Bruce



Re: bind HTML table to ADO persisted recordset client-side

Postby Mark J. McGinty » Fri, 30 Sep 2005 03:05:16 GMT






Persisted to a file on the client and persisted to a data island are really 
the same basic things, you can open a recordset by passing it an XML 
DOMDocument object (which exposes an IStream) or you can open it by passing 
it a file name, or even a URL -- it makes no difference really.

Not sure what TDC is -- do you mean RDC?  You will want to use an RDC object 
but you can hook it up to data on the fly, by setting its SourceRecordset 
property to an open recordset object.  Sort it using the RDC.recordset 
property.

Not that I want to be disingenous about the task, but there isn't much more 
to it than that, and the databound-related attributes on the table and its 
cells.


-Mark







Re: bind HTML table to ADO persisted recordset client-side

Postby Bruce Hensley » Fri, 30 Sep 2005 03:55:26 GMT

Mark,

Thanks.  After looking into RDS, this is approximately what I have ...

<html><head><title>test</title>
<script language="VBScript">
    const cn = "Provider=MSPersist"
    const df = "full path to datafile.adtg"
    dim rs
    set rs = createobject("ADODB.Recordset")
    rs.open df, cn
    msgbox rs.recordcount 'gives accurate result
    dim dc
    set dc = createobject("RDS.DataControl")
    dc.SourceRecordset = rs
    dc.refresh 'error: One or more arguments are invalid
 </script></head><body>
<table datasrc="#dc">
<tbody>
    <tr>
        <td><span datafld="fieldname1"></span></td>
        <td><span datafld="fieldname2"></span></td>
        <td><span datafld="fieldname3"></span></td>
    </tr>
</tbody></body></html>

The msgbox accurately reflects the recordcount.

However, the dc.refresh throws the error "One or more arguments are
invalid".  Without the dc.refresh line I get no errors, but I get no data in
the table.

TDC = Tabular Data Control ... a data source object that can handle simple
delimited text files, like CSVs.  Instead of persisting the source recordset
to open in this HTM, I thought I might write a CSV from it, starting with
the result of a recordset.GetString.

Is ADOR another alternative?

Thanks for your help.

Bruce








then
really
passing
object
more



Re: bind HTML table to ADO persisted recordset client-side

Postby Mark J. McGinty » Fri, 30 Sep 2005 14:49:39 GMT

"Bruce Hensley" <nobody@nowhere> wrote in message
news: XXXX@XXXXX.COM ...

Connection is unnecessary.


This should be:

Set dc.SourceRecordset = rs

I've never done the RDC that way, I've always defined an object tag, and
then referenced it as a property of the document. (This is not to say it
won't work that way, just that I've never done it.)

<OBJECT id=RDC1 style="DISPLAY: none"
VIEWASTEXT classid=clsid:BD96C556-65A3-11D0-983A-00C04FC29E33>
<PARAM NAME="ExecuteOptions" VALUE="2">
<PARAM NAME="FetchOptions" VALUE="3">
<PARAM NAME="InternetTimeout" VALUE="30000">
</OBJECT>

As you can see there are no data details, I hooked it up in script on the
fly, as you are doing. So it becomes:

Set document.RDC1.SourceRecordset = rs

-Mark






Re: bind HTML table to ADO persisted recordset client-side

Postby Bruce Hensley » Fri, 30 Sep 2005 23:41:26 GMT

ark,

Thanks. I got it working with the object tag as follows ...

<OBJECT classid="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" ID="dc"
style="display:none">
<PARAM NAME="SQL" VALUE="full path to data file.adtg">
<PARAM NAME="CONNECT" VALUE="Provider=MSPersist">
</OBJECT>
<TABLE id="table1" datasrc="#dc">

It needed no other startup code. And I got the column sort I was after with
the following ...

sub table1_onclick
dc.sortcolumn = window.event.srcElement.id 'with an id spec'd on each
column
dc.refresh
end sub

Would the other parameters in your example help performance? It currently
takes about 4-5 seconds to load 650 records from a local fileshare (or
refresh after clicking a column to sort).

Thanks again for your help.

Bruce

"Mark J. McGinty" < XXXX@XXXXX.COM > wrote in message
news:rcL_e.172088$Ji4.44694@fed1read03...
data
simple
with
SourceRecordset



Re: bind HTML table to ADO persisted recordset client-side

Postby Bruce Hensley » Sat, 01 Oct 2005 00:05:31 GMT

o answer my own question ...

The executeoptions and fetchoptions params are the default values, and
recommended for better performance in docs at MS.

Also after skimming the docs, I replaced the sql and connect params with a
single url param pointing at the datafile.

I'm still wondering if 5 seconds for a refresh of only 650 records is
reasonable. If so, is the time lost in the binding operation? We have
static pages, with the same amount of data, that load "instantly".

Thanks,
Bruce

"Bruce Hensley" <nobody@nowhere> wrote in message
news: XXXX@XXXXX.COM ...
with
it
the
client,
use
and
RDC.recordset
much
and



Re: bind HTML table to ADO persisted recordset client-side

Postby Mark J. McGinty » Sun, 02 Oct 2005 04:50:07 GMT

"Bruce Hensley" <nobody@nowhere> wrote in message
news:% XXXX@XXXXX.COM ...

Consider how much more there is to do to open a document with a data bound
table, versus a flat html file, and the performance issue you describe loses
its mystery.

Are you paging the data or causing it to bind all 650 rows before the
document becomes interactive? The table that's bound to data takes on a few
extra properties and methods, that allow you to page the data, such as
dataPageSize, previousPage() and nextPage().

I have a page that dynamically builds a table in script (to match the fields
in the recordset) bound to data with ~15K rows, dataPageSize = 50, and it
opens in a sub-second -- from SQL Server even (locally persisted data should
be faster under almost all conditions.)

-Mark







Re: bind HTML table to ADO persisted recordset client-side

Postby Bruce Hensley » Sun, 02 Oct 2005 06:02:01 GMT

Mark,

I bind the whole thing, but asynchronously, so the page is available
immediately and only the rows off the bottom of the page update over the 4-5
seconds.  The interactive parts of the page are functional immediately.  So,
this is quite workable.

I suspected what you say was the case ... that is, that building a page from
code rather than binding would be faster.  But, it takes 2 lines of code to
do the sorting with the binding and I'm running short of coding time (and
I'm in unfamiliar territory), so I'll think I'll stick with what I have for
now.  On the other hand, you've provided me with a lot of good info I can
use when a more demanding problem comes along.

Thanks again for all your help.

Bruce








a
loses
few
fields
should
[old stuff snipped]



Re: bind HTML table to ADO persisted recordset client-side

Postby Mark J. McGinty » Tue, 04 Oct 2005 07:46:39 GMT

"Bruce Hensley" <nobody@nowhere> wrote in message
news: XXXX@XXXXX.COM ...

You're quite welcome -- actually, it's sort of refreshing to see someone
else interested in it. A few years ago I took it on as a personal growth
project, to work out all the details for read/write data bound to html
elements. At some point I had to quit tracking the time I had into it,
because the numbers became irksome to view, but by then I'd fallen into
Concord Logic (assessing value based on what has been invested into
something, rather than what it is worth) and had to see it through.

In the end it was clear that its uses were limited, the number of potential
threat scenarios (given its writeability) was ungodly... writability extends
the attack surface by miles!

Anyway, glad to help.

Good Luck,
Mark






Return to ADO

 

Who is online

Users browsing this forum: No registered users and 29 guest