Custom Datasource - InfoPath Dev
in

InfoPath Dev

Custom Datasource

Last post 08-05-2008 02:24 AM by ben.oates. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-04-2008 09:30 AM

    Custom Datasource

    Hi all,

    Is it possible in VBScript in Infopath to filter a secondary data source before it is retrieved? I have an SQL Server database with a few thousand lines returned from the query I run at the moment.

    The idea is similar to a question answered elsewhere on the forum, where I copy lines from this, secondary datasource into a local one which are user selected.

    What I would like to do, is use variables to cut down the number of rows returned from the server to save time (it takes ages at the moment!) based on entries in the data source it will be copied to.

    So... in the repeating User section, I have a button saying "Search User". If the "Name" field has anything in it, the response from this button in a repeating table will be cut down based on the contents of that field. We'll get into the complexities of setting a variable to be eventObj.Source a bit later. At this early stage I would like to know how I change the databinding (MyDetails) SQL before the data is retrieved so that it doesn't have to pull back thousands of rows every time.

    Apologies for all the questions today, but this last week has been my first venture into coding for Infopath and all the online help seems to be JScript!

    Thanks in advance everyone.

  • 08-05-2008 02:24 AM In reply to

    Thanks to help elsewhere in this forum, everything is finally slotting into place!

    In case anyone else wants to change the query command to make their datasource connections more efficient it's actually very simple.

    Set myDS = XDocument.DataObjects("DataSource Name")

    myDS.QueryAdapter.Command = sqlStatement

    myDS.Query

    Hope this helps.

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.