As is common to all uses of ADO in Delphi you have to call Coinitialize before you use it. Otherwise you get the error "CoInitialize has not been called".
To do this with Xdata you change the connection unit as follows:
1. Add activex to the uses clause.
2. Within createfactory make it say:
function: IDBConnection
begin
CoInitialize(nil);
Result := CreateConnection;
end
begin
CoInitialize(nil);
Result := CreateConnection;
end
3. And you need to set the connectionstring too in createconnection:
class function TdbGoMSSQLConnection.CreateConnection: IDBConnection;
var
DataModule: TdbGoMSSQLConnection;
begin
DataModule := TdbGoMSSQLConnection.Create(nil);
var
DataModule: TdbGoMSSQLConnection;
begin
DataModule := TdbGoMSSQLConnection.Create(nil);
datamodule.connection.connectionstring:='filename=c:\myudl.udl' //for example
Result := TDbGoConnectionAdapter.Create(DataModule.Connection, 'MSSQL', DataModule);
end;