|
-
August 9th, 1999, 04:45 PM
#1
Inheritance for recordsets
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
-
August 19th, 1999, 04:12 AM
#2
Re: Inheritance for recordsets
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 : [email protected]
[email protected]
Hand Phone : +(6) 016 2237147 (Malaysia)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|