Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Display Record Locks

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Display Record Locks

    I have written an application using VBA that queries data from an AS400 file. In several instances I received different data from the queries. I do know that the data did not change during my tests. However, I believe a user may have had a lock on the records which prevented me from retrieving them in my recordset. I have been successful in calling the DSPRCDLCK odbc function but have not been able to get the results of that function. The results are written to a spool file. I have manually signed on using client access session and displayed the spool file but I need the information returned to my application. If the record I am querying is locked I will inform the user that this particular record is in use at this time. Does anyone have a vb example of how to return the results from the dsprcdlck command? Thank you, Robert Maxwell
    Code

  • #2
    Display Record Locks

    Robert, You could add code to copy the report to a database file and then use a select statement to read the file file. It will include page headings and column heading as well as information about record locks, but you could add code to identify just the record lock data. Try adding these lines of code: on iSeries build a work file...CRTPF FILE(lib/file) RCDLEN(136) In VB... cmd.Run "CPYSPLF FILE(QPDSPRLK) TOFILE(lib/file) JOB(user/QPRTJOB) SPLNBR(*LAST) MBROPT(*replace)" cmd.Run "DLTSPLF FILE(QPDSPRLK) JOB(user/QPRTJOB) SPLNBR(*LAST)" Good Luck! Kevin

    Comment

    Working...
    X