Please support our Pascal and Delphi advertiser: Programming Forums
Views: 2683 | Replies: 1
![]() |
•
•
Join Date: Apr 2007
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
I've written this program which at the mo only has two buttons. One to exit the program and the other to open a report from an external Microsoft Access database file. I'm getting this error message:
Debugger Exception Notification - Project Project1.exe raised exception class EOleSysError with message "Operation Unavailable". Process Stopped. Use Step or Run to continue.
Here's the code:
Any help would be much appreciated
Debugger Exception Notification - Project Project1.exe raised exception class EOleSysError with message "Operation Unavailable". Process Stopped. Use Step or Run to continue.
Here's the code:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComObj;
type
TForm1 = class(TForm)
Label1: TLabel;
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
Access: Variant;
const
acViewNormal = $00000000;
acViewDesign = $00000001;
acViewPreview = $00000002;
begin
try
Access := GetActiveOleObject('Microsoft Access.Application');
except
Access := CreateOleObject('Access.Application');
end;
Access.Visible := True;
Access.OpenCurrentDatabase('P:\ICT\Write\Computing\CPT L6\NEW CPT3\XmnrTable.mdb', True);
Access.DoCmd.OpenReport ('Report 1', acViewPreview, EmptyParam, EmptyParam);
Access.CloseCurrentDatabase;
Access.Quit(1);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Application.terminate;
end;
end.Any help would be much appreciated
•
•
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation:
Rep Power: 2
Solved Threads: 16
i haven't worked with ole, the only thing which i can suggest is the following tutorials
http://delphi.about.com/sitesearch.h...de=3176&type=1
http://delphi.about.com/sitesearch.h...de=3176&type=1
there you should find some answers
best regards,
http://delphi.about.com/sitesearch.h...de=3176&type=1
http://delphi.about.com/sitesearch.h...de=3176&type=1
there you should find some answers
best regards,
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode