﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » vfp 9.0 autoincrement question &amp; possible solution</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:18:16 GMT</lastBuildDate><ttl>20</ttl><item><title>vfp 9.0 autoincrement question &amp; possible solution</title><link>http://forum.strataframe.net/FindPost10808.aspx</link><description>As pointed out in another post, vfp doesn't support @@identity.&amp;nbsp; I did some research on this and found that the vfpoledb provider version 9.0&amp;nbsp;does support "GETAUTOINCVALUE(0);" (version 8 doesn't).&amp;nbsp; With the 0 parameter it is supposed to provide the exact same functionality as @@identity&amp;nbsp;provided you call executescalar before closing the connection.&amp;nbsp; &lt;/P&gt;&lt;P&gt;So I added a KeepConnectionOpen protected property to the dbdatasourceitem class.&amp;nbsp; In the UpdateRow function&amp;nbsp;&amp;nbsp;I added the line KeepConnectionOpen =&amp;nbsp;True if loCommands(1) exists (we have autoincrementing table).&amp;nbsp; In the internalexecutenonquery()&amp;nbsp;function of the dbDataSourceItem class I check for that value so it won't allow it to close the connection if we have an autoincrementing field.&amp;nbsp; After that I set KeepConnectionOpen = False. So far this seems to work.&lt;/P&gt;&lt;P&gt;Is there anything that I might have overlooked? It seems like a simple solution.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Marcel&lt;/P&gt;&lt;P&gt;&lt;FONT color=#a31515 size=2&gt;&lt;BR&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Mon, 13 Aug 2007 15:22:08 GMT</pubDate><dc:creator>Marcel Heitlager</dc:creator></item><item><title>RE: vfp 9.0 autoincrement question &amp; possible solution</title><link>http://forum.strataframe.net/FindPost10831.aspx</link><description>No.&amp;nbsp; Thanks for the information.&amp;nbsp; We have not tested that, so like anything else, you may want to make sure that you do not have any issues when there are multiple-users hitting the file at the same time.&amp;nbsp; That would be my only caution. :)</description><pubDate>Mon, 13 Aug 2007 15:22:08 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>