home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 6 Unleashed…sional Reference Edition)
/
Visual_Basic_6_Unleashed_Professional_Reference_Edition_Sams_1999.iso
/
Source
/
CHAP35
/
309X3703.TXT
< prev
next >
Wrap
Text File
|
1998-05-03
|
879b
|
29 lines
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