If you need to customize a dialog box that allows you to set Data Link Properties, You can first consider using the "Data Link Properties" dialog box that comes with the system.
The call method is very simple. In the project, the ADODB. dll and oledb32.dll are introduced, the former is the. NET library, and the latter is the com Library (Microsoft ole db service component 1.0 Type Library ). Use the followingCode:
ADODB. Connection adodbconnection = new ADODB. Connection (); object connection = (object) adodbconnection; msdasc. datalinks DLG = new msdasc. datalinks (); DLG. promptedit (ref connection );
The "Data Link Properties" dialog box that comes with the system can be opened. Common Data Link Attributes can be set here. Finally, the required connectionstring attribute can be obtained through the input "connection" parameter, that is, "adodbconnection ".Program.
Published in my blog at the same time