home *** CD-ROM | disk | FTP | other *** search
-
- Dim gTest As New RDO.rdoConnection 'Global RDO connection used by all the forms
-
- Private Sub Form_Load()
-
- Dim rsTest As RDO.rdoResultset 'Define a local RDO Resultset
-
- 'Set up the RDO connection parameters. These
- 'Will vary from one SQL Server to another.
- With gTest
- .Connect = "uid=sa;pwd=;DSN=PubsDB;"
- .CursorDriver = rdUseOdbc
- .EstablishConnection rdDriverNoPrompt
- End With
-
- 'Fill combo box
- Set rsTest = gTest.OpenResultset("Select au_id from pubs..authors", rdOpenStatic)
-
- 'Open the recordset using the global connection
- Set rsTest = gTest.OpenResultset("Select * from pubs..authors", rdOpenStatic)
-
- 'Set the data control resultset
- 'This data control could be bound to a grid or
- 'other controls, however it will not use a new
- 'user connection. Instead it will use the global connection.
- Set MSRDC1.Resultset = rsTest
-
- End Sub
-