Thứ Sáu, 16 tháng 12, 2011

ASP: Working with multiple Recordset

sSQL = "SELECT categoryId, categoryName FROM Categories WHERE categoryId > 3"
sSQL = sSQL & ";SELECT RegionId , RegionDescription FROM Region"
sSQL = sSQL & ";SELECT ShipperID, CompanyName, Phone FROM Shippers"

set oRS = Server.CreateObject("ADODB.Recordset") oRs.Open sSQL, sConnectString

Do While Not oRs.EOF '......some processing here     oRs.MoveNext Loop

'To set the next Recordset to the same Recordset (encouraged) Set oRS = oRS.NextRecordset()

'To set the next Recordset to some other Recordset object, in order 'to still be able to access the contents of oRS Set oSomeOtherRS = oRS.NextRecordset()

(http://www.4guysfromrolla.com/webtech/083101-1.shtml)

Không có nhận xét nào:

Đăng nhận xét