NOTICE  |  twitter.com/kichulkim |  Kevin is...

In .NET it is very easy to use the OleDB datalink connection dialog to build Connectionstrings at runtime.

To do this, you must first add references to both the
Microsoft ActiveX Data Objects 2.x Library (=ADODB namespace)
and the
Microsoft OLE DB Service Component 1.0 Type Library (=MSDASC namespace).


In C# the code looks something like this:

public string GetOLEConnectionString(string currConnString)
{
     string connString = string.Empty;

     MSDASC.DataLinks dataLinks = new MSDASC.DataLinksClass();
     ADODB.Connection ADOConn = new ADODB.ConnectionClass();

     ADOConn.ConnectionString = currConnString;
         
     object oConnection = (object)ADOConn;
         
     if (dataLinks.PromptEdit(ref oConnection))
     {
           connString = ADOConn.ConnectionString;
     }
     else
     {
           connString = currConnString;
     }
     return connString;
}


Referred to:
http://support.microsoft.com/kb/310083/en-us
Trackback :: http://coolmool.com/trackback/41
난 가끔 네가 이런걸 읽고 이해할수 있다는게 신기해....
2007/11/30 11:26
제가 쓴건디요 -_-;

2007/11/30 17:50

더더욱 놀라울 따름;;;
2007/11/30 17:55
전공이쟎습니까;;;

2007/11/30 18:21

 이전  1 ... 192021222324252627 ... 58   다음 

전체 (58)
Kevin Kim (58)
Someone (0)
최근트랙백
fotowall :: ncloud tattertools RSS Feeds today : 863   yesterday : 216
total : 1240237