Running Date Displays the Data Link Properties window, get the ADO connection string

xiaoxiao2021-03-06  65

#include

#include

#include

WideString BuildConnectionstr ()

{

WideString Connectionstr;

CComptr PDSL;

CCOMQIPTR <_Connection> PCONN;

Coinitialize (NULL);

Try

{

IF (S_OK == PDSL.COCREATEINSTANCE (__ uuidof (datalinks))))

{

IF (S_OK == PDSL-> PromptNew (iDispatch **) & pconn))

{

PCONN-> GET_CONNECTIONSTRING (ConnectionsTR);

Return Connectionstr;

}

}

}

__finally

{

Couninitialize ();

}

}

转载请注明原文地址:https://www.9cbs.com/read-120065.html

New Post(0)