Using COM to check a connection
Posted on 2004-09-21
How can I check a connection using COM. I have the following routine:-
function CustomCreateUDLFile(aUDLPath : WideString) : Boolean;
DataInit : IDataInitialize;
DataInit := CreateComObject(CLSID_DataLinks) as IDataInitialize;
Result := True;
// at this point I want to check if the connection string brought back is valid
>>> ??? ala pressing the test button on the udl form.
Result := False;
The reason I don't want to use an ADO connection, is that this function is in a seperate shared unit. I know that it would be easier to create an ado connection and try and connect, but is the other option possible?