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. General Programming
  3. Visual Basic
  4. Sql Update/insert

Sql Update/insert

Scheduled Pinned Locked Moved Visual Basic
databasesql-serversysadminquestionannouncement
2 Posts 2 Posters 0 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.
  • C Offline
    C Offline
    charchabil03
    wrote on last edited by
    #1

    Having a client who connects to servers automatically and insert data in a DB. and in the same time.. having a user who works on these data,update and delete them... i m afraid , that these 2 process run in the same time. and worried about the data (insert and update in the same time) note the Database is SQL Server Xpress Edition Do you think Sql lockes the Tables while working on them ? is there a way to lock the tables? for not using them with 2 process?

    Regards Ramy

    J 1 Reply Last reply
    0
    • C charchabil03

      Having a client who connects to servers automatically and insert data in a DB. and in the same time.. having a user who works on these data,update and delete them... i m afraid , that these 2 process run in the same time. and worried about the data (insert and update in the same time) note the Database is SQL Server Xpress Edition Do you think Sql lockes the Tables while working on them ? is there a way to lock the tables? for not using them with 2 process?

      Regards Ramy

      J Offline
      J Offline
      JUNEYT
      wrote on last edited by
      #2

      Good question :) Actually SQL server waits for each connection session to to be done for database and then it updates the database with the change. However, when you deal with ADO to access a database to perform any action such as DELETE, UPDATE, etc., you should consider in opening the database with pesimistic or optimistic locking methods. I have given a sample below. If Response.IsClientConnected = True Then Set ObjectRecord = Server.CreateObject ("ADODB.Recordset") ObjectRecord.CursorLocation = adUseServer ObjectRecord.CursorType = adOpenkeyset ObjectRecord.LockType = adLockOptimistic ObjectRecord.Open GetTableName, ObjectConnection,,,adCmdTable 'adcmdtext for SQL Query End If I hope that helps :wtf: Journey

      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