Monday, February 16, 2009

ASP's Fast Way To Pull Data from Database

This is a great way to pull in all records from a (MSSQL) database in ASP.

use the GetString() function for your record set!  It is pretty simple and really cool.  Here is my example:

set rs = Server.CreateObject("ADODB.Recordset")
myvariable = rs.GetString (2, , vbTab, vbCrLf, "Null")

Here is the info on the function GetString:

string = recordsetobject.GetString (StringFormat, NumRows, ColumnDelimiter, RowDelimiter, NullExpr)

For more details go here: DevGuru ADO Recordset::GetString Method

No comments: