Multi-record set Multiple Recordset

zhaozj2021-02-16  135

Sometimes you will encounter such a situation, the information in the same web page is from several different information sheets, so you will open a Recordset for every information, in which this article will introduce you to another. Alternatives "Multiple Records".

What is multiple records What is Multiple Recordsets? Simply put multiple SELECT instructions into one, and each other instruction is separated by a semicolon (;), the recordsets that are opened with this instruction is Multiple Recordset! Let's take an example, the plot is as follows: Use the database: SQL internal construction of the North Air Database Target: Produce three drop-down menu, is "Staff List", "Product List", "Product Category Inventory" You may pull every drop down The creation of the formula has enabled a recordset. I believe that you will feel very troubles, and we will waste system resources Now let's take a look at how to use Multiple RecordSet to simplify the work <% 'creation RecordSet object set ics = server.createObject ("adoDB .Recordset ") 'Use OLEDB Provider, YoursqlServername Please change to your server name sconnstring =" provider = SQLOLSERVERNAME; "_ &" data source = yoursqlserName; "_ &" initial catalog = northwind; "_ &" user id = sa Password = "'Multi-select directive, each instruction is; SASQL =" SELECT EMPLOYEEES "_ &" ORDER BY EMPLOYEID; "_ &" Select ProductID, ProductName from Products "_ &" Order by ProductID; "_ &" select categoryid, categoryname from categories "_ &" order by categoryid "ips.open ssql, sconnstring, 0, 1 i = 1" Take the Nothing feature to check if the last Recordset Do While Not (ORS Is Nothing) Response.write "

CopyRight © 2020 All Rights Reserved
Processed: 0.045, SQL: 9