vfp 9.0 autoincrement question & possible solution


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
No.  Thanks for the information.  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.  That would be my only caution. Smile
Marcel Heitlager
Marcel Heitlager
StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)StrataFrame User (202 reputation)
Group: StrataFrame Users
Posts: 84, Visits: 835
As pointed out in another post, vfp doesn't support @@identity.  I did some research on this and found that the vfpoledb provider version 9.0 does support "GETAUTOINCVALUE(0);" (version 8 doesn't).  With the 0 parameter it is supposed to provide the exact same functionality as @@identity provided you call executescalar before closing the connection. 

So I added a KeepConnectionOpen protected property to the dbdatasourceitem class.  In the UpdateRow function  I added the line KeepConnectionOpen = True if loCommands(1) exists (we have autoincrementing table).  In the internalexecutenonquery() 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.  After that I set KeepConnectionOpen = False. So far this seems to work.

Is there anything that I might have overlooked? It seems like a simple solution.

Thanks,

Marcel


 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search