- Posts: 109
Pass Parameters from Access to FH
- JD Cox
- Topic Author
- Offline
- User
Less
More
2 years 2 weeks 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
Thanks, JD
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
2 years 2 weeks ago #3674
by FlowHeater-Team
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.
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$’
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.
- JD Cox
- Topic Author
- Offline
- User
Less
More
- Posts: 109
2 years 1 week 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
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.
- FlowHeater-Team
- Offline
- Admin
2 years 1 week ago #3676
by FlowHeater-Team
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.
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.
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.
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.
- JD Cox
- Topic Author
- Offline
- User
Less
More
- Posts: 109
2 years 1 week ago - 2 years 1 week 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
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: 2 years 1 week ago by FlowHeater-Team.
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
- Offline
- Admin
2 years 1 week ago - 2 years 1 week ago #3678
by FlowHeater-Team
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.
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.
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: 2 years 1 week ago by FlowHeater-Team.
Please Log in or Create an account to join the conversation.
- JD Cox
- Topic Author
- Offline
- User
Less
More
- Posts: 109
2 years 1 week 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
Thanks for your help Robert
JD
Please Log in or Create an account to join the conversation.
Time to create page: 0.294 seconds