Microsoft Office 2000 Developer |
The topic Creating a DataEnvironment Object for Use in a DLL File demonstrates how to compile a DataEnvironment object in a DLL file. The compiled DLL can now be used as a data source for any Office application.
To use the DLL as a data source
Note The name of your DLL may not appear in the list of DLLs if, when creating the DLL, you used the Project Properties dialog box on the Tools menu and wrote a description in the Project Description box. If so, that description appears as the name of the DLL in the list.
Dim myDE As New deNwind.DataEnvironment1
Private Sub PrintRecordset()
Dim myDE As New deNwind.DataEnvironment1
Dim rsCustomers As New Recordset
Set rsCustomers.DataSource = myDE.ReturnRS("Customers")
While Not rsCustomers.EOF
Debug.Print rsCustomers.Fields(1).Value
rsCustomers.MoveNext
Wend
rsCustomers.Close
Set myDE = Nothing
End Sub