Jump to content

ActiveX Control


This topic is 6534 days old. Please don't post here. Open a new topic instead.

Recommended Posts

There I was having a random read through the FM help manual and what do you know, i stumble on a wonderful section that lets me execute scripts in filemaker files without showing the application.

Okay, well thats fun, really it is, however, my question is the following.

I need a specific script executed once a day. However, it requires uploading somewhere, so the internet connection has to be valid. What i need to happen is, if the internet connection isn't available, i need to execute the script again in 5 minutes (i suppose i could build this into the actual FM script).

Okay, then slight change in question, if i wanted to put this on the server, how processor / ram intensive would it be re: actually opening FM (not visible) running the script and closing it?

Cheers,

~Genx

Link to comment
Share on other sites

Opening FM is always done locally, not on the server. The ActiveX control basically opens the full FM app but does not draw the interface until you set the visible property to "true". If FM is already running it will hook into the running instance. It's just as RAM/processor intensive as running the app visibly.

One other thing: in FM7/8 the ActiveX implementation cannot open a hosted file directly. We could do that in FM5/6 but it doesn't work anymore. So you'd have to open a local file that opens the hosted file.

Since we're talking about VBscript or VB or other programming language to do this in, you can check for internet connectivity in that language. A lot more robust than trying to do this in FM.

Why not bypass this ActiveX thing completely and write something that talks to the XML publishing side: you can extract the data you want and upload it to the internet. You can even run a script if you need it.

You can use PHP with fx.php, or VB.NET/C# with fmDotNet to make this easy.

Link to comment
Share on other sites

Well, i realized that FM only ever opens on the client rather than on the server, i just need this script to always execute at a certain time and the only computer that is always on is the server...

As for the XML idea, i'm a bit confused. To be honest all i want to do is extract specific data at that point, however don't i need FMSA to do it? Or am i just lost? Any resources you could point me to Wim... i'd really appreciate it.

Cheers,

~Genx

Link to comment
Share on other sites

Yes, to ask for data directly from the server you need FMSA. Small price to pay for the power it gives you.

To work with XML publishing you basically construct a URL with your find request (and optionally the request to perform a script).

On the FMSA CD there is a database called "Query String Reference.fp7" that explains how to make the URL.

What you get back from FMSA is basically an XML document. See http://www.connectingdata.com/fmdotnet.htm for an example.

Now, in your choice of programming or scripting languages you can construct & execute the URL and receive that XML in memory. From there you can do anything with it that you like. That's what fx.php and fmDotNet do: they take the pain away of having to know how to construct the URL and they transform the received XML into something useful for the programmer. Arrays in the case of fx.PHP, .NET DataSet in the case of fmDotNet.

Here's a PDF of an example I've written with fmDotNet: http://www.connectingdata.com/report_desktop.pdf

The short & skinny of this is: pick your favorite programming or scripting language and write something that will take the FM data from FMSA and upload it to the web or anything else. It's not that hard to do and it's very rewarding.

Stying within FM to do this will require a robot client machine that is always on. It'll save you the cost of FMSA minus the cost the robot machine. And it will never be as stable as talking to FMSA directly.

Link to comment
Share on other sites

Thanks Wim, I'll look into it, though i don't think the bosses are likely to go on a spending spree any time soon. We've got a couple of computers lying around so... might just hook one up and use it as your so called "robot machine". I will however look into your techniques nonetheless - even if for future reference.

Thanks loads Wim.

Link to comment
Share on other sites

This topic is 6534 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.