Board index » delphi » TDoCmd.OpenReport() - "Class not registered"

TDoCmd.OpenReport() - "Class not registered"

Using D5 Enterprise, MS Access 97, Jet 4.0 Drivers

When using the TDoCmd.OpenReport() method to run a report stored in a MS Access table, I get the
following error: "Class not registered"

What library do I need to register to get this to work?  I know the report is fine since I can
run it in MS Access 97.  Here's a simple example:

AccessApplication1.Connect;
AccessApplication1.OpenCurrentDatabase('C:\Temp\SomeLib.mdb', False);
DoCmd1.OpenReport('SomeReport', $00000000, EmptyParam, EmptyParam);

It fails on the OpenReport() function above.  Can anyone help?

Thanks,
Jon.

 

Re:TDoCmd.OpenReport() - "Class not registered"


I have Delphi 5 Update Pack 1.  Is there another update you're talking about?

Thanks,
Jon.

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:3992333b.88389169@forums.Inprise.com...

Quote

> >When using the TDoCmd.OpenReport() method to run a report stored in a MS Access table, I get
the
> >following error: "Class not registered"

> I don't see that error.  Have you installed the Delphi 5 update?
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:TDoCmd.OpenReport() - "Class not registered"


I even have Update Pack 1 installed at home, and I get the exact same error at my home PC (Win
98 with Access 97).

Thanks,
Jon.

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:3992333b.88389169@forums.Inprise.com...

Quote

> >When using the TDoCmd.OpenReport() method to run a report stored in a MS Access table, I get
the
> >following error: "Class not registered"

> I don't see that error.  Have you installed the Delphi 5 update?
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:TDoCmd.OpenReport() - "Class not registered"


Yes, I have Delphi 5 Update Pack 1 installed.  Are you talking about a different update?

Thanks,
Jon.

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:3992333b.88389169@forums.Inprise.com...

Quote

> >When using the TDoCmd.OpenReport() method to run a report stored in a MS Access table, I get
the
> >following error: "Class not registered"

> I don't see that error.  Have you installed the Delphi 5 update?
> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:TDoCmd.OpenReport() - "Class not registered"


Quote

>When using the TDoCmd.OpenReport() method to run a report stored in a MS Access table, I get the
>following error: "Class not registered"

I don't see that error.  Have you installed the Delphi 5 update?
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:TDoCmd.OpenReport() - "Class not registered"


Quote
>I have Delphi 5 Update Pack 1.  Is there another update you're talking about?

Yes I was referring to that update pack.  But I miss read you message and though
you where referring to a compile error.  When I run your project I get the same
error.

If you just want code to print an Access report try this
procedure TForm1.dgAccessRunReport(ReportName,
                            WhereCondition: String;
                            database:string);
{Runs an Access report using automation.}
var
  Access:          Variant;
  AliasParams:     TStringList;
  I:               Integer;
begin
  {Get the path to the Access database using the alias name.}
  AliasParams := TStringList.Create;

  Access := CreateOleObject('Access.Application');
  Access.OpenCurrentDatabase(Database);
  {Print the report.}
  if WhereCondition = '' then
    Access.DoCmd.OpenReport(ReportName)
  else
    Access.DoCmd.OpenReport(ReportName,,,WhereCondition);
  {Close Access.}
  Access.Quit;
  Access := varNull;
end;

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads