Skip to main content
simply more productive

The Data Specialist

Thanks to our intuitive transformation designer, you can convert data effortlessly to a variety of formats without knowing how to program. It’s not only efficient, it’s also easy to use.
Flowheater Chart

Pass Parameters from Access to FH

More
1 year 11 months ago #3673 by JD Cox
Pass Parameters from Access to FH was created by JD Cox
I have an access app for users to generate invoicing.  I want the end user to select a customer and an invoice date then click a button that runs FH, executing a stored procedure.  How do I pass those parameters from access to FH?  I know I can execute the stored procedure with a pass-through query in access but I would like to use FH to generate multiple reports, log the transaction and update records.

Thanks, JD

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #3674 by FlowHeater-Team
Replied by FlowHeater-Team on topic Pass Parameters from Access to FH
Hi JD,

you can to this with the help of FlowHeater Parameter .

For example, you can call the Batch Module with the /SetParameter option like this
     FHBatch.exe /SetParameter invoice=1234 /SetParameter date="11/09/2022" AccessExport.fhd

In the FlowHeater Definition you can use this parameter in your SQL Statement to hand over the given values

e.g.
     exec sp_fhtest @invoice = ‘$invoice$’, @dt = ’$date$’

 

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #3675 by JD Cox
Replied by JD Cox on topic Pass Parameters from Access to FH
Robert, as always thank you.

That helped me sort out the parameters from batch to the definition.  But I still cannot pass them from MS Access to the batch file.

File_Path = "C:\WINDOWS\explorer.exe  \\~\INVOICE_DATA.bat"

If I SET the parameters in the batch file and execute it from Access the definition run great.

Shell File_Path, vbNormalFocus

File_Path = "C:\WINDOWS\explorer.exe  \\~\INVOICE_DATA.bat 143"

But as soon as I try to SET the parameters in Access shell only opens windows explorer, nothing else happens.

Looks like it’s possible, guess I’m missing something.

JD

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #3676 by FlowHeater-Team
Replied by FlowHeater-Team on topic Pass Parameters from Access to FH
Hi JD,

Why you are calling explorer.exe?

You can call FHBatch.exe or a script (.cmd | .bat) directly with the MS Access shell command.

e.g.
    Shell """C:\Program Files (x86)\FlowHeater V4\BIN\FHBatch.exe"" /SetParameter p1=test1 /SetParameter p2=test2 ""C:\Temp\test.fhd"""

Please find attached a short example.

 

File Attachment:

File Name: access-shell-cmd.zip
File Size:57 KB

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago - 1 year 11 months ago #3677 by JD Cox
Replied by JD Cox on topic Pass Parameters from Access to FH
Wow…did not know that.  Works great, super fast too.     FH_PATH = """C:\~\FHBatch.exe"""
    FH_LOG = " /LogFile \\10.0.0.0\~\INVOICE_LOG_.log"
    FH_PARAM1 = 143
    FH_PARAM2 = "10/25/2022"
    FH_PARAMS = " /SetParameter FH_BCID=" & FH_PARAM1 & " /SetParameter FH_INV_DATE=" & FH_PARAM2
    FH_DEF = " \\~\INVOICE_DATA.fhd"    Shell FH_PATH & FH_PARAMS & FH_LOG & FH_DEF

It does produce a warning for the parameters in the log file.  Is that to be expected?
It still works and the user has no idea.\~\INVOICE_DATA.fhd,Warning,Warning : Parameter [FH_BCID] does not exist  the Parameter will be dynamically generated!
\~\INVOICE_DATA.fhd,Info,Set Parameter [FH_BCID]  Value [143]
\~\INVOICE_DATA.fhd,Warning,Warning : Parameter [FH_INV_DATE] does not exist  the Parameter will be dynamically generated!
\~\INVOICE_DATA.fhd,Info,Set Parameter [FH_INV_DATE]  Value [10/25/2022]Thanks, JD
Last edit: 1 year 11 months ago by FlowHeater-Team.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago - 1 year 11 months ago #3678 by FlowHeater-Team
Replied by FlowHeater-Team on topic Pass Parameters from Access to FH
Hi JD,

You may ignore this warning ? In case you would like to suppress this warning you just have to create the used parameter names into the definition, see screenshot below, that’s all.

 

Best wishes
Robert Stark

Did this answer your question? We would be grateful if you provide a brief comment as feedback. It may also help others who may have encountered a similar problem.
Last edit: 1 year 11 months ago by FlowHeater-Team.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #3679 by JD Cox
Replied by JD Cox on topic Pass Parameters from Access to FH
Simple enough

Thanks for your help Robert

JD

Please Log in or Create an account to join the conversation.

Time to create page: 0.297 seconds
FlowHeater Logo

FlowHeater - The Data Specialist

Efficient data integration and transformation with FlowHeater – the perfect solution for a seamless transfer of your data.

Legal information

Support & Contact

Contact

Phone:
0951 / 9933 9792

eMail:
This email address is being protected from spambots. You need JavaScript enabled to view it.


Copyright © 2009-2024 by FlowHeater GmbH. All rights reserved.