Testing a connection

Hi guys,

I am trying to write a function to test a connection. Currently I am adding a new connection to the connection manager then returning that connection by name.

with daCxnMgr.Connections.Add do
begin
  Name := 'TestConnection';
  ConnectionType := 'UniDAC?AuxDriver=Oracle;SpecificOptions.UseUnicode=True;SpecificOptions.UnicodeEnvironment=True;SpecificOptions.ThreadSafety=True;Server=test;Database=test;UserID=test;Password=test*123;';
end;

lTestCxn := daCxnMgr.NewConnection('TestConnection');

When I run this, I get an “EDAException with message’Unknown driver’.” exception. This connection string was copied directly from the DASchema connection string field which verifies from the IDE.

What is happening that may cause this error?

Thanks
N

Hi,

you are using UniDAC driver here.
have you added uDAUniDACDriver.pas unit into your project?

I figured it out… just shows how tired I was. I set the connection string to the ConnectionType property so it wasn’t parsing the driver and throwing an exception.

Thanks