欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp ADO GetString函數(shù)與用GetString來提高ASP的速度第1/2頁

 更新時間:2007年12月21日 20:05:34   作者:  
沒想到asp下有g(shù)etstring這個東西,看樣子不熟悉這塊啊,以后考慮用這個,應(yīng)該不錯,另外還有g(shù)etrows等,都是asp下提高性能不錯的函數(shù)。
rs.getstring的方法GetString的作用是:以字符串的形式返回指定的記錄集??梢允褂眠@個方法向ASP文件中添加HTML表格。
getstring 方法語法
Set str=objRecordset.GetString(format,n,coldel,rowdel,nullexpr) 
Parameter參數(shù) Description描述
format Optional. A StringFormatEnum value that specifies the format when retrieving a Recordset as a string
可選參數(shù)。指定一個
n

Optional. The number of rows to be converted in the Recordset
RecordsetStringFormatEnum值。它是用于指定提取記錄集的格式

coldel Optional. If format is set to adClipString it is a column delimiter. Otherwise it is the tab character
可選參數(shù)。如果format[格式]值設(shè)置為adClipString,那么它就是一個列界定符;除此之外,它便是一個tab[制表符]
rowdel Optional. If format is set to adClipString it is a row delimiter. Otherwise it is the carriage return character
可選參數(shù)??蛇x參數(shù)。如果format[格式]值設(shè)置為adClipString,那么它就是一個行界定符;除此之外,它便是一個carriage return [回車符]
nullexpr Optional. If format is set to adClipString it is an expression used instead of a null value. Otherwise it is an empty string
可選參數(shù)??蛇x參數(shù)。如果format[格式]值設(shè)置為adClipString,那么它就是一個用于替代空值的表達(dá)式;除此之外,它便是一個空字符
案例
To create an HTML table with data from a recordset, we only need to use three of the parameters above:
我們只要通過上述三個參數(shù)中的一個就可以創(chuàng)建HTML格式的記錄集數(shù)據(jù)表:

coldel - the HTML to use as a column-separator 
coldel – 使用HTML格式作為列分隔符 
rowdel - the HTML to use as a row-separator 
rowdel – 使用HTML格式行分隔符 
NullExpr - the HTML to use if a column is NULL 
NullExpr – 如果列為空,則使用HTML 
Note: The GetString() method is an ADO 2.0 feature.
在下面的案例中,我們將使用GetString()方法將記錄集以一個字符串的形式保留:

復(fù)制代碼 代碼如下:

<html> 
<body><% 
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", connstr=rs.GetString(,,"</td><td>","</td></tr><tr><td>","&nbsp;") 
%><table border="1" width="100%"> 
  <tr> 
    <td><%Response.Write(str)%></td> 
  </tr> 
</table><% 
rs.close 
conn.close 
set rs = Nothingset conn = Nothing%></body> 
</html>  

Constant
常量
Value
Description
描述
adClipString 2 Delimits rows by the rowdel parameter, columns by the coldel parameter, and null values by the nullexpr parameter
指定rowdel參數(shù)對行(記錄)進(jìn)行界定;通過coldel參數(shù)對列(字段)進(jìn)行界定,通過nullexpr參數(shù)對空值進(jìn)行界定

相關(guān)文章

最新評論