| {\rtf1\ansi\ansicpg1252\deff0\deflang1044{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}} \viewkind4\uc1\pard\f0\fs17 This shows you how to use the ADO's NextRecordset Method to request multiple resultsets at once. See the comments for further information. \par \par Private Sub cmdLoad_Click() \par Dim rs As ADODB.Recordset \par Set rs = New ADODB.Recordset \par \par 'Run multi select statment \par rs.Open "SELECT au_lname FROM authors; SELECT fname FROM employee", "dsn=pubs", adOpenForwardOnly, adLockReadOnly \par \par Do While Not rs.EOF \par Me.lstAu.AddItem rs.Fields(0) \par rs.MoveNext \par Loop \par 'Get Next rs \par Set rs = rs.NextRecordset \par \par Do While Not rs.EOF \par Me.lstEmp.AddItem rs.Fields(0) \par rs.MoveNext \par Loop \par \par Set rs = Nothing \par End Sub \par \par } |
ADO NextRecordset Method Demonstration |
India web developer web development India | India web development company India ecommerce web developer