Manually Invoke Cube Processing -
07-21-2005
, 02:23 AM
Hi there,
I have recently upgraded my server to Windows Server 2003 SP1. SQL Server
2000 is at SP4 with Analysis Services installed. I am using the DSOCtrl.DLL
found at:
http://www.databasejournal.com/featu...nt.php/1462631
which once allowed me to process any cube on the server. Now, from my XP SP1
workstation, if I try and run that code (below) from a Delphi program I get
error:
"ActiveX Component Can't Create Object"
I have installed PTS, added appropriate users to OLAP Administrators, added
same to RepositoryUser role, etc. etc.
Can anyone shed any light on to why this error is occurring?
Thanks,
Kim.
__________________________________________________ ___________
unit Unit1;
interface
uses
Windows, Messages, SysUtils, ActiveX, Variants, Classes, Graphics,
Controls, Forms,
Dialogs, ComObj, DSOCTRL_TLB, UCrpeClasses, UCrpe32, StdCtrls;
type
TfmReports = class(TForm)
Button1: TButton;
Crpe1: TCrpe;
Label13: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
fmReports: TfmReports;
implementation
{$R *.dfm}
procedure TfmReports.Button1Click(Sender: TObject);
var
objDSOCtrl : Variant;
int : integer;
begin
if MessageDlg('This report will first refresh the OLAP "IR" cube - doing
this now!', mtInformation,
[mbOk, mbCancel], 0) = mrOK then
begin
Crpe1.Clear;
//
Crpe1.ReportName := 'E:\Share\sms\reports_sql\R11_OLAP.rpt';
//Crpe1.ReportName := 'R11_OLAP.rpt';
//******* VIP *********
Crpe1.DiscardSavedData;
//******* VIP *********
Crpe1.Formulas.Clear;
Crpe1.Selection.Formula.Clear;
objDSOCtrl := CreateOLEObject('DSOCtrl.OLAPProc');
objDSOCtrl.Server := 'OIC01';
objDSOCtrl.Database := 'Stats';
objDSOCtrl.Cube := 'IR';
//***** Error occurs at following line:
Label13.Caption := objDSOCtrl.LastProcessed;
//***** Error occurs at line above:
objDSOCtrl.ProcessType := processRefreshData;
fmReports.Cursor := crHourGlass;
int := objDSOCtrl.ProcessCube;
Label13.Caption := 'Finished refresh of "IR"... ReturnVal=' +
IntToStr(int)+ ' (0 = "OK")';
fmReports.Cursor := crDefault;
Label13.Caption := '';
Crpe1.Execute;
end;
end;
initialization
CoInitialize(nil); // <-- manually call CoInitialize()
finalization
CoUnInitialize; // <-- free memory
end. |