<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Preventing duplicate records been written to an SQL Database</title><link>https://www.infopathdev.com:443/forums/thread/53131.aspx</link><pubDate>Fri, 26 Mar 2010 05:14:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53131</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53131.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=53131</wfw:commentRss><description>&lt;p&gt;Hi Andrew and welcome,&lt;/p&gt;
&lt;p&gt;I just responded to another thread and explained why having a tight coupling to SQL is a bad idea. Check it out: &lt;a href="http://www.infopathdev.com/forums/t/14967.aspx"&gt;http://www.infopathdev.com/forums/t/14967.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Probably the easiest thing for you to do is to just query the table and see if the ID exists and if it does, hide the button that submits. You don&amp;#39;t need to write code in the form to do this if you use a Web Service. Form-based coding is a bad practice because of the higher costs when you have to maintain that code across many different XSNs. You could write a simple Web Service that takes an ID&amp;nbsp;parameter and queries your table and returns true or false and then use that to set conditional visibility for your button to &amp;quot;disable&amp;quot; it if the return is true. Easy to do. Or, if you don&amp;#39;t want to code, you could install Qdabra&amp;#39;s free &lt;a title="DBXL" href="http://www.qdabra.com/en/products/DBXL.aspx"&gt;DBXL&lt;/a&gt; trial and setup the query in 10-15 minutes. &lt;/p&gt;
&lt;p&gt;Happy trails!&lt;/p&gt;</description></item><item><title>Preventing duplicate records been written to an SQL Database</title><link>https://www.infopathdev.com:443/forums/thread/53092.aspx</link><pubDate>Wed, 24 Mar 2010 23:30:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53092</guid><dc:creator>awwilkie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53092.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=53092</wfw:commentRss><description>&lt;p&gt;Hi there, I could use some assistance. I have created a timesheet in InfoPath that writes to a MSSQL database. I want to prevent duplicate timesheets being written. Essentially there are two fileds (1) Employee ID and (2) Start Date that identify unique timesheets.&lt;/p&gt;
&lt;p&gt;I need to check if there is an existing record that matches these two fields, and if so&amp;nbsp;I want to prevent the user from creating a new timesheet. Anyone have any experience with this?&lt;/p&gt;
&lt;p&gt;I expect I need to query either in VB code (having troubles finding good examples)&amp;nbsp;or directly on the form. But I find that doing a query after initiating &amp;#39;new record&amp;#39; causes some problems. Any help or direction would be good :)&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Andrew&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>