Thanks, I was able to use the examples in that thread to add a where clause
to my secondary data source SQL. I'm still having one problem with it,
though. The first time the form is used, the where clause is generated
correctly. If the form is used again without exiting InfoPath, a second where
clause is appended to the first one resulting in a syntax error. Can you give
me an example of how to revert bacak to the original SQL statement prior to
adding the where?
> Try this link
> http://groups.google.com/group/microsoft.public.infopath/browse_thread/thread/3e
ac3d1470eb5127/b8c6d0e40e5ab032?q=Secondary+data+source+query&rnum=1#b8c6d0e40e5
ab032
[quoted text clipped - 10 lines]
> > can see the posting, since I am having similar problems with a secondary data
> > source?
S.Y.M. Wong-A-Ton - 27 May 2006 06:49 GMT
Save the original Command in a variable. Then after you run Query(), set the
Command back to the original SQL statement you saved in the variable.
So put something like the following at the beginning of the code but after
var strSQL = XDocument.DataObjects["PICCT_APPL"].QueryAdapter.Command; :
var strOrigSQL = strSQL;
Put the following after XDocument.DataObjects["PICCT_APPL"].Query(); :
XDocument.DataObjects["PICCT_APPL"].QueryAdapter.Command = strOrigSQL;
---
S.Y.M. Wong-A-Ton
> Thanks, I was able to use the examples in that thread to add a where clause
> to my secondary data source SQL. I'm still having one problem with it,
[quoted text clipped - 18 lines]
> > > can see the posting, since I am having similar problems with a secondary data
> > > source?