Solved

Running an Access '97 report via dde

Posted on 1998-04-15
2
176 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 300 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

696 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