β Learning not just technology, but dreams!
Home HTML JAVASCRIPT CSS VUE REACT PYTHON3 JAVA C C++ C# AI GO SQL LINUX VS CODE BOOTSTRAP GIT Local Bookmarks
ADO Tutorial
ADO Tutorial
ADO Introduction
ADO Database Connection
ADO Recordset
ADO Display
ADO Query
ADO Sorting
ADO Adding Records
ADO Updating Records
ADO Deleting Records
ADO Script Acceleration
ADO Command Object
ADO Connection Object
ADO Error Object
ADO Field Object
ADO Parameter Object
ADO Property Object
ADO Record Object
ADO Recordset Object
ADO Stream Object
ADO Data Types
ADO Summary
ADO Examples
ADO Deleting Records
ADO Command Object
Accelerating Scripts with ADO's GetString()
Use the GetString() method to accelerate your ASP scripts (replacing multiple Response.Write statements).
Multiple-line Response.Write
The following example demonstrates one way to display database query results in an HTML table:
For large queries, this approach increases script processing time because the server must process numerous Response.Write commands.
The solution is to build a complete stringβfrom
βand output it using only a single Response.Write.
The GetString() Method
The GetString() method enables us to display all data with just one Response.Write call. It also eliminates the need for do..loop code and conditional tests to check whether the recordset has reached EOF.
Syntax
str = rs.GetString(format,rows,coldel,rowdel,nullexpr)
To create an HTML table from recordset data, we only need three of the above parameters (all parameters are optional):
coldel β HTML used as column delimiter
rowdel β HTML used as row delimiter
nullexpr β HTML used when a column is null
Note: The GetString() method is an ADO 2.0 feature. You can download ADO 2.0 from the following URL: http://www.microsoft.com/data/download.htm
In the following example, we use the GetString() method to store the recordset as a string:
Example
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT Companyname, Contactname FROM Customers", conn
str=rs.GetString(,,"
"," | | "," ")
%>
The variable str above contains a string comprising all columns and rows returned by the SELECT statement. Between each column appears | , and between each row appears |
| . Thus, the desired HTML is generated with just one Response.Write.
ADO Deleting Records
ADO Command Object
ByteArk Coding Plan
Supports mainstream large models including Doubao, GLM, DeepSeek, Kimi, MiniMax, etc., officially supplied for stable and reliable service.
Β₯9.9
/ month
Subscribe Now
iFLYTEK Xingchen Coding Plan
Includes free model invocation quotas; supports DeepSeek, GLM, Kimi, MiniMax β a one-stop experience and deployment platform.
Β₯3.9
/ month
Subscribe Now
Click to Share Notes
Category Navigation
Python / Data Science
AI / Intelligent Development
Frontend Development
Backend Development
Databases
Mobile Development
DevOps / Engineering
Programming Languages
Computer Fundamentals
XML / Web Service
.NET
Web Development
Advertisement
Explore Further
Scripts
Programming
Networking
Computer Servers
Scripting Languages
Data Management
Computer
Programming Languages
ADO Tutorial
ADO Tutorial
ADO Introduction
ADO Database Connection
ADO Recordset
ADO Display
ADO Query
ADO Sorting
ADO Adding Records
ADO Updating Records
ADO Deleting Records
ADO Script Acceleration
ADO Command Object
ADO Connection Object
ADO Error Object
ADO Field Object
ADO Parameter Object
ADO Property Object
ADO Record Object
ADO Recordset Object
ADO Stream Object
ADO Data Types
ADO Summary
ADO Examples
Online Examples
Β· HTML Examples
Β· CSS Examples
Β· JavaScript Examples
Β· Ajax Examples
Β· jQuery Examples
Β· XML Examples
Β· Java Examples
Character Sets & Tools
Β· HTML Character Set Settings
Β· HTML ASCII Character Set
Β· JS Obfuscation/Encryption
Β· PNG/JPEG Image Compression
Β· HTML Color Picker
Β· JSON Formatter
Β· Random Number Generator
Latest Updates
Β· GraphRAG Beginner Tutorial
Β· Dart Enums and Symbols
Β· Dart Unit Testing
Β· Dart Concurrency and Iso...
Β· Dart Stream
Β· Dart Asynchronous Programming
Β· Dart Package and Library Management
Site Information
Β· Feedback
Β· Disclaimer
Β· About Us
Β· Article Archive
Follow on WeChat
My Favorites
Bookmark Articles
Browsing History
Clear All
No records yet
|