I don't know anything about ODBC databases, but your code could certainly be improved.
You only need to put the .s at the end of a string variable the first time, when you declare it. Also, adding to a string can be done more simply. So this:
Code:
html.s = html.s + "abc"
could be written as:
Code:
html + "abc"
The STYLE attribute should be in lower case.
The FONT tag is deprecated and should not be used.
#ffffff could be written as
#fff or even just
white.
Instead of applying the same style attributes to elements individually (eg. "text-decoration:none; "), use CSS. This would greatly shorten the string variables you're juggling in PB.
width=15% should be
width='15%', with apostrophes or speech marks. That is valid HTML. The same goes for href attributes.
You are closing anchor elements with
</s> instead of
</a>.
Within PB, you are reading data into string variables that do nothing but get merged into other string variables. This is inefficient. Instead of:
Code:
part_number.s = GetDatabaseString(0, 2)
html.s = html.s + "<td width=15%><a STYLE='text-decoration:none' href=" + record_id + ">" + part_number + "</s></td>"
do:
Code:
html + "<td class='my_td'><a href='" + record_id + "'>" + GetDatabaseString(0, 2) + "</a></td>"
with this class defined at the start:
Code:
.my_td { width:15%; }
.my_td a { text-decoration:none; }
Do all of those things then try the new code. It should be faster than your current version.
It may be that the slowness of the program is not PB creating the HTML, but the webgadget struggling to parse the HTML you've fed it. You really need to be careful with HTML, especially if the webgadget is Internet Explorer.