FLOCK() is nuts as you know. You can create the stored proc in a DBC and have it access the free tables without any problem. If the GetNewID code does the RLOCK() and releases it once it has the new key you should be good to go. Not sure of the .NET code and how it executes the Stored Proc, but I can tell you the stored proc will do the same job as a procedure in the main.prg.
I would recommend the DBC in the same folder as the free tables. The only reason for putting it on the server is to have it have access to the tables without pathing problems. It has nothing to do with the locking. Rick White Light Computing, Inc. www.whitelightcomputing.com www.swfox.net www.rickschummer.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of MB Software Solutions General Account Sent: Wednesday, June 17, 2009 05:09 PM To: [email protected] Subject: Using RLOCK to get PKs from your meta-table (VFP9SP1) Importance: High My Fox apps have never had a problem using the GetNewID stored proc that came with Fox samples all the way back to (I think) VFP5 days. Sylvan uses a similar set of commands but because their app uses free tables, this code exists inside our main PRG, which is called from various areas in the app. Not the best design, but this app was created in the early 90s so I'm not complaining. ;-) We've got a vendor who's got a DotNet app (C#) that's using VFP OLEDB and instead of RLOCK, he's using FLOCK (and calling it without even checking the return value---yeah, I know...bad idea!). My question is this: I thought that RLOCK only works from your instance of FoxPro, but I was successful in using it for years since I was calling a common stored procedure in the database. Please confirm! Also, how would this outside C# vendor best be advised to approach replicating the same logic? My first thought---because our Sylvan app uses FREE tables, not a DBC---was for me to create a DBC that would reside on the LAN in the FREE tables folder that would contain the GetNewID stored proc logic and his C# app would just call that stored proc to return a value to him? Remember that all the tables will remain free tables, so I can't put them into this new DBC. Steve had emailed me offline and I appreciated that, but now I want to know about this idea of creating a stored-proc-only dbc. Also, I should have that DBC on the server where the free tables resides, right? I think I couldn't have it locally because the LOCK wouldn't be respected? Please advise...thanks! -- Mike Babcock, MCP MB Software Solutions, LLC President, Chief Software Architect http://mbsoftwaresolutions.com http://fabmate.com http://twitter.com/mbabcock16 [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/019901c9ef94$d4945920$7dbd0b...@com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

