Status One-use data configuration <% set connection = server.createObject ("adoDb.connection) connectionString =" Provider = msdatashape; data provider = sqloledb.1; persist security info = true; user ID = sa; password = 123; initial catalog = northwind; data source = (local) "Connection.Open (connectionString)
SQL = _ "Shape {Select Customerid from customers}" & _ "append ({select Orderid, Customerid from Orders})" & _ "Relate Customerid to Customerid"
SET RS = Connection.execute (SQL)
Do WHILE NOT RS.EOFRESPONSE.WRITE (RS (0) & "-" & rs.fields.count) response.write ("
") set rschild = rs ("chaporders"). Value do while not rschild. EOF response.write (Rschild (0) & "& RSCHILD (1) &" - "& rschild.fields.count) Response.write ("
") rschild.movenext loop rschild.close.movenextLoop
Set RsChild = NothingRs.CloseSet Rs = NothingConnection.CloseSet Connection = Nothing%> transmitted following SQLSET NO_BROWSETABLE ONgodeclare @ P1 intset @ P1 = 1exec sp_prepare @ P1 output, NULL, N'SELECT OrderID, CustomerID FROM Orders', 1select @ P1goSET NO_BROWSETABLE OFFgoSELECT CustomerID FROM Customers; SELECT OrderID, CustomerID FROM OrdersgoSET NO_BROWSETABLE ONgoexec sp_unprepare 1go two state without using data configuration <% Set <- - METADATA tYPE = "TypeLib" UUID = "00000200-0000-0010-8000-00AA006D2EA4"!> Connection = Server.CreateObject ( "ADODB.Connection") ConnectionString = "PROVIDER = SQLOLEDB.1; Persist Security Info = True; User ID = sa; Password = 123; Initial Catalog = Northwind; Data Source = (local)" Connection. Open (connectionString) SQL = "Select Customers.customerid, Orders.Orderid, Orders.customerid from [Customers], [Orders] Where customers.customerid = Orders.customerid
SET RS = Connection.execute (SQL)
Do While Not Rs.eOfResponse.write (RS (0) & "-" & rs.fields.count) Response.write ("
") rs.movenextLoop
Rs.CloseSet Rs = NothingConnection.CloseSet Connection = Nothing%> transmitted following SQLexec sp_reset_connectiongoSELECT Customers.CustomerID, Orders.OrderID, Orders.CustomerID FROM [Customers], [Orders] WHERE Customers.CustomerID = Orders.CustomerIDgo Needless to say overall efficiency It is not a big classification and the forum. I would rather use joint queries to achieve the same effect using joint queries.