+ Reply to Thread
Results 1 to 6 of 6

Identifying locked records in table

  1. #1
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Identifying locked records in table

    Hi Forum

    I have a number of excel workbooks that help us in production and post data into various databases via SQL commands. One of these is a 4D database, which normally is used via its own client. However, I do some updates to these tables from time to time. The problem is, I have not found a way of checking whether the record I need to update is locked, so once in a while these updates return an error. However, it is very generic... "Server rejected the connection" which happens with the 4D write database whenever there is a problem, syntax or otherwise. Thus I can't use the error to trap the condition that the record is simply locked.
    Does anyone have any suggestions on how to check whether a record in a table is locked, and if possible by who?
    I appreciate any suggestions.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Identifying locked records in table

    Maybe create a UDF to check if a cell is locked, then loop all the records on a table.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Identifying locked records in table

    JieJenn, thanks, but while I can modify the records and values in the database, I cannot change its structure, and the database is part of our Job Managment Software. My problem is that when the normal software users are using records through the client program, I cannot run my updates. My programs are addons to the software that drives our production system.

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Identifying locked records in table

    Ah. Tough situation. Honestly, without all the details I don't have an answer. Hopefully other experts can jump in provide some insights.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Identifying locked records in table

    Hello Arkadi,

    If you are wanting to check the SQL record status of a Recordset, you would need to check 2 or 3 properties of the recordset: LockType, State, and/or Status. I don't know of any shorter method. Perhaps your SQL version does have something though.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  6. #6
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Identifying locked records in table

    Thanks Leith, my biggest problem there is that the odbc driver to connect to the 4D database is not great, and my recordsets will not allow me to write data. When reading I use recordsets a lot, but given their limitations, in this application I use the execute method to post information rather than a recordset update. Because the rs is so limited, I can't get a lot of useful status info out. I was hoping someone here might know a command to actually query the db as to the lock status of the record in question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2007 : Identifying Duplicate Records
    By markdtp in forum Excel General
    Replies: 1
    Last Post: 03-04-2011, 09:18 PM
  2. Identifying duplicate records
    By cobe170781 in forum Excel General
    Replies: 1
    Last Post: 09-18-2009, 06:29 PM
  3. Identifying duplicate rows (not just records)
    By mc515 in forum Excel General
    Replies: 2
    Last Post: 05-20-2008, 11:34 AM
  4. [SOLVED] Identifying records with Zero in the data section
    By sumitk in forum Excel General
    Replies: 2
    Last Post: 07-13-2006, 06:30 PM
  5. Systematically Identifying Duplicate Records
    By MWS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2006, 03:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1