Or just use the OLE Container control and DAO....
You can use DAO in the same project as ADO, so why not take advantage of it?
Set the DataSource of the OLE Container to a DAO Datacontol and the OLE Container's DataField to the OLE field name in the database. Just add the DAO data control to the form with-out setting any properties, and then create a DAO recordset and set the data control's recordset to the rs object:
Set Data1.Recordset = myRS
The Data Control will take all of the connection info from the recordset.
Of course, seeing's how this is an OLE container, an application that can open Bmp files (like MS Paint) must be present on the machine.
This method works for any OLE type: Excel files, Word files, etc.. Again, you need to have a application on your machine that can open these files. Then the OLE containe will use these applications to open present the data (of course, the file must be associated with the application).
You can also allow or prevent the user from editing the file when right mouse clicking on the container, and if they can edit the data, you can have the associated application open with-in the container, looking as if it is part of your application (you will need a default menu item on your form, and set the NegotiateMenus property of the form to True, and NegotiateToolbars of your MDI form also to true, in order to see the application's menu items), or you can have the application itself open up with the data. [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!