Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Trying to Lock Records in ODBC

Trying to Lock Records in ODBC

Scheduled Pinned Locked Moved Database
databasehelpquestion
3 Posts 2 Posters 20 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ariel
    wrote on last edited by
    #1

    Hi there, Well i'm trying to figure out a way to lock a record when i'm editting it and it seems i can't find the way. First, I'm using ODBC and my DB is both in Access and FoxPro - i'm not sure wether the lock of the record is handled by ODBC Drivers or the DB itself - so if somone can help me with that i'll be more than happy. Second, I'm trying to change the CRecordset::SetLockingMode(CRecordset::pessimistic) and i get an exception which tells me i'm actualy back to default CRecordset::Optimistic (Locking Mode) - those this have to do with my ODBC Driver or my Access DB. Third, is there a flag in CRecordset which tells me whether the Record is edited by another user or only the ODBC/DB (???) handles and know it ? Actually what i'm asking in a one sentence is : Can i check if a record is edited by another user in another process or i have to put my own Semaphore for this ??? Thank you alot for reading all this and much more if help given, Ariel.

    A 1 Reply Last reply
    0
    • A Ariel

      Hi there, Well i'm trying to figure out a way to lock a record when i'm editting it and it seems i can't find the way. First, I'm using ODBC and my DB is both in Access and FoxPro - i'm not sure wether the lock of the record is handled by ODBC Drivers or the DB itself - so if somone can help me with that i'll be more than happy. Second, I'm trying to change the CRecordset::SetLockingMode(CRecordset::pessimistic) and i get an exception which tells me i'm actualy back to default CRecordset::Optimistic (Locking Mode) - those this have to do with my ODBC Driver or my Access DB. Third, is there a flag in CRecordset which tells me whether the Record is edited by another user or only the ODBC/DB (???) handles and know it ? Actually what i'm asking in a one sentence is : Can i check if a record is edited by another user in another process or i have to put my own Semaphore for this ??? Thank you alot for reading all this and much more if help given, Ariel.

      A Offline
      A Offline
      Anders Molin
      wrote on last edited by
      #2

      Record locking is handled by the database engine itself... - Anders

      A 1 Reply Last reply
      0
      • A Anders Molin

        Record locking is handled by the database engine itself... - Anders

        A Offline
        A Offline
        Ariel
        wrote on last edited by
        #3

        First, Thanks for your answer ! Second, Since the DataBase is Locking the Records is there a way i can check wether the record is locked in a specific moment ? Is there a way i can know if the record is editted right now ? Ariel

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups