During my work as a software engineer I was repeatedly asked to get some information out of a database and create some sort of file out of it or to send it by email. To make this task easier i created a templating mechanism and called it DBPublisher. Over the years that library grew in functionality and flexability. DBPublisher is a library written in Visual Basic 6 and can be access from every programming language that can call an activex dll.

  • Easy datasource and source query definition
  • Complete free template format. (plain text, html or any other format you can think of)
  • section grouping and sub grouping
  • Include other templates which could have a different datasource. (sub forms)
  • Write the result to one or more files in a folder, FTP it to an other server or send it as an email (bulk email)

The total DBPublisher source code can be downloaded from here.

Below you can see a sample of a simple publishing template. In the downoad above more samples are available (including mail and ftp samples)

<!-- HTT-PARAMETERS>
    DSN          = Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NorthWind.mdb;Persist Security Info=False
    Recordset    = Select * from Demo
    PageGrouping = CustomerID
    TargetDir    = ../samples/
</HTT-PARAMETERS -->

<html>
    <title>All <%CompanyName%> orders</title>
       <%INCLUDE header.htt%>
       <center>
            <table>
                <tr><td colspan=99>This page was generated on <%Date%> at <%Time%> by '<%App.ProductName%>'
                    version <%App.version%><br><br></td></tr>
                <tr><td colspan=99><%INCLUDE orders.htt;CustomerID=CustomerID%></td></tr>
                <tr><td><br> </td></tr>
                <%GROUP OrderID%>
                    <tr><td colspan=6><a name="<%OrderID%>"></a>Order : <%OrderID%> date : <%OrderDate%></td>
                        <td colspan=4>Class variables</td></tr>
                    <tr><td>Product</td><td>category</td><td>Quantity</td>
                        <td>Unit price</td><td>Discount</td><td>Price</td>
                        <td>Counter</td><td>Even</td><td>In group</td>
                        <td>Greenbar</td></tr>
                    <%GROUP DetailSection%>
                        <tr>
                             <td><%ProductName%></td>
                             <td><%CategoryName%></td>
                             <td><%Quantity%></td>
                             <td><%UnitPrice%></td>
                             <td>- <%Discount%></td>
                             <td><%Price%></td>
                             <td<%EvenRecord%>>(<%RecordNumber%>)</td>
Share