ADO, as an OLE DB consumer, makes requests to a provider to access data sources and retrieve the desired information. In ADO, you supply the name of the provider either as part of a connection string , or in the Provider property of the Connection object. The steps to make the connection depends on whether your Simple Provider is registered as a full OLE DB Provider or not.
In the following example, when the Simple Provider is registered as a full OLE DB provider, the steps are:
The corresponding code follows:
con.Provider = "SampleOSP_VB"
con.Open
rs.Open " C:\Oledbsdk\Osptk\Samples\Customer.txt", con
In the following example, when the Simple Provider is not registered as a full OLE DB provider, but it's Data Source Object is registered, the steps are:
The corresponding code follows:
con.Provider = "MSDAOSP"
con.Properties("Data Source") = "SampleOSP_VB.MyDataSource"
con.Open
rs.Open " C:\Oledbsdk\Osptk\Samples\Customer.txt", con