Solved

Running an Access '97 report via dde

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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