Lesson 1:overview
--------------------------------------------------------------------------------
This article serves as a quick ' how to ' example for-using string buffering to concatenate strings in a VB
Component. The example VB code would generate a HTML TABLE record, that'll be sent to a ASP file
Being populated with data from a database table. The GetRows () method is used to acquire the data
From a example Access database.
In many circumstances, sending a Variant array populated by GetRows (), (or a RecordSet) to a ASP file
From a VB component was the recommended way to build an HTML TABLE record. Choose to
Build an HTML TABLE record, or other database dependant code, within the VB component itself before sending
It to a ASP file. This May is not set, "true believers" in ' not mixing HTML and VB code. I tend
To being agnostic and I find sacrificing orthodoxy for speed are sometimes called for with server-side
Components. In no regard, this programming choice are exemplified here.
Rather than sending the HTML code from the VB component with the Response.Write method, you can optionally
Collect the HTML within a string and send it back as a complete HTML TABLE record. This avoids the need to
Instantiate the ASP object within the VB component. It also allows other VB code to use your component
without reference to ASP. You "re just generating pure HTML code which any COM object can be use. But when
Putting together a large HTML string in VB, the concatenation operant ' & ' can slow your code down
significantly.
We ' ll be creating two methods, MethodName () and Dobuffer (). The MethodName () method would acquire data from
A database and then use this data to construct an HTML TABLE record it'll send to the calling ASP file in
One lump sum. Our ASP file would initially call the MethodName () method with an SQL statement, a connection
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.