0

So based on a field in my form, i want to execute a sql query when that field changes.

Ive set up the data connection, but as far as i can see, the connection is static and there is no way to manipulate the query based on the field from my form. Has anyone achieved this, or might someone have a smart solution to this problem?

For me, i cannot understand why this limitation exists, as the whole point about including external datasources for me, would have to be that one can query it based on dynamic parameters.

2 Answers 2

1

Alexandar,

I would suggest you to use a separate Web Service for getting data to InfoPath.. In Web Service, use Object Model to connect database and query!

Or, if you can do VSTA Code on InfoPath form (needs administrative approval for InfoPath form, each time you publish the form).. Here is an example:
Dynamic SQL Data connection in InfoPath

EDIT
Seems possible duplicate of:
Filtering Secondary SQL data connection with value from Main data connection

1
  • Thanks, as the form is for a custom list and from what I understand i can not include VSTA code in my form because of that - The only solution seems to use a web service.
    – Kembo
    Sep 3, 2013 at 6:17
0

If you only want to filter your datasource, you can execute the connection for all items, after you get the result of your datasource connection, you can filter the results based on your field on your form. Hope this helps you.

1
  • Thanks, but sadly I cannot filter, as the datasource is really big(several million items to query)- so I have to apply the "filter" before the connection is made.
    – Kembo
    Sep 2, 2013 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.