Data Link API for OLE DB - Where is it?

Hi People,

I want to create a connect string to an unpsecified OLE DB provider. After some searching I found the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/datalinkapioverview.asp

Which states "Because the Data Link API is included with OLE DB as a core component, the user interface is always available to your application users if ADO or OLE DB is properly installed on their system."

This is wonderful, excactly what I need, except that the documentation does not tell me where to find it... which com dll do I need to reference to get this dialog box?

Even better, since I am using ADO.NET 2 in my application, is there a .NET version of this component?

Thanks....

Aranda

[1012 byte] By [Aranda] at [2007-12-23]
# 1

OK, Answered my own qeustion... Thanks to Pete Shanahan:

http://www.petesh.com/archives/2005/10/good_old_promptdatasource.html

The code is:

MSDASC.DataLinks oDL = new MSDASC.DataLinksClass();
ADODB.Connection conn = new ADODB.ConnectionClass();
conn.ConnectionString = "Provider=sqloledb";
object oConn = (object)conn;
oDL.PromptEdit(ref oConn);
OleDbConnection xconn = new OleDbConnection(conn.ConnectionString);
xconn.Open();

And it requires the following com references:

Microsoft ActiveX Data Objects 2.8 Library

OLE DB Service Component 1.0 Type Library

Aranda at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

Interestingly, there is NO DOCUMENTATION on DataLinksClass in MSDN libraries.

Fasty1 at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified