?
Solved

Running an Access '97 report via dde

Posted on 1998-04-15
2
Medium Priority
?
180 Views
Last Modified: 2010-04-06
I'm trying to run an access 97 report via dde. I'he put a TddeClientConv  component on the form and have set it for a a manual connect mode. (pressing a button fires it up)
Acceaa begins to run minimized, and i am in the right data base.But this is a far as I can go. I have setup another button to execute the macro (Iguess this is what I want) But nothing is executed , I could be using the wrong commands for acess; I'm not sure...anywhay here is a sample of the code:
procedure TForm1.Button1Click(Sender: TObject);
var
 zFileName,zParams,zDir:Array[0..79] of char;
 FileName:String;
begin
x.SetLink('C:\Program Files\Microsoft Office\Office\MSACCESS.EXE','d:\metro\suburban\wsscout\prod.mdb');
x.OpenLink;
end;

procedure TForm1.Button3Click(Sender: TObject);
var
zFileName,zParams,zDir:Array[0..79] of char;
 FileName:String;
begin
filename:='"quit"';  // just tried something simple
StrpCopy(zFileName,FileName);
if x.ExecuteMacro(zfilename,true) then showMessage('ok')
 else
  showMessage('no'); // always comes up no
end;


What are the commands (macros ,Etc )to do this if possible ?

thanks
0
Comment
Question by:psutton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
AndersWP earned 1200 total points
ID: 1361549
I would recommend using OLE automation instead. You could use a procedure somewhat like the following:

Uses
  Windows, ComObj;

Var
  Access: Variant;

begin
  Access:=CreateOleObject('Access.Application.8');
  Access.OpenCurrentDatabase('MyDB.mdb');
  Access.DoCmd.RunMacro('MyMacro');
  Access.Quit;
end;

Note that when using automation, you can directly access and manipulate all access objects, including reports, directly. You do not have to use a macro.

You can look in the Access 97 help file under "Application Object" for a description of the access automation object hierarchy.

You should be aware that using Access in this way will not exactly give you Roadrunner speed. Access is also a pig with memory, you will need at least 32MB to get a reasonable performance. I think this goes for using DDE as well.

I hope this will help you.

Greetings,
AndersWP
0
 

Author Comment

by:psutton
ID: 1361550
Thanks, it worked . Appreciate the help
paul Sutton
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question