#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 ();
}
}