Click to See Complete Forum and Search --> : Inheritance for recordsets


beren
August 9th, 1999, 04:45 PM
Hi. I'm going to build quite a lot of recordsets. These are going to be so similar that I'd like to build one which the others are derived from, thus using normal inheritance like I use in C++ etc. How is this best done in Visual Basic?

Yours sincerely

Niklas

askus
August 19th, 1999, 04:12 AM
Instead of executing one query at a time, SQL Server allows you to issue and execute a batch of queries. When executing a batch of queries, more than one result set can be generated. In additional batches of queries, multiple result sets can also be generated by SQL statements that include COMPUTE BY and COMPUTE clauses, or by stored procedures that contain more than one SELECT statement.
When multiple result sets are generated, it is important to retrieve one result set at a time until no more result sets are available. The NextRecordset method of the Recordset object allows you to retrieve any subsequent Recordset objects. If no more result sets are available, the returned Recordset object is set to Nothing.

The ADO code is as follows:
Dim cmd As New ADODB.Command
Dim rs As ADODB.Recordset

Cmd.ActiveConnection = "DSN=pubs;UID=sa"
Cmd.CommandText = "myNextProc"
Cmd.CommandType = adCmdStoredProc

Set rs = Cmd.Execute()
While Not rs Is Nothing
If (Not rs.EOF) Then
Debug.Print rs(0)
End If
Set rs = rs.NextRecordset()
Wend


The Ultimate Solution Providers

Authors

Sriman & Jayaraman

Email : solutionproviders@hotmail.com
solutionproviders@yahoo.com

Hand Phone : +(6) 016 2237147 (Malaysia)