MS Access To SQL Data Transfer With Begin Trans

Results 1 to 2 of 2

Thread: MS Access To SQL Data Transfer With Begin Trans

  1. #1
    Join Date
    Dec 1969
    Posts
    70

    Default MS Access To SQL Data Transfer With Begin Trans

    I Want to transfer data to an SQL db from an Access DB through ASP code. After the transfer is complete I want to Update the Access DB. Here how will I use a Begin Trans and Commit Trans.

  2. #2
    Join Date
    Dec 1969
    Posts
    1,315

    Default RE: MS Access To SQL Data Transfer With Begin Trans

    Typically, you want to protect your database from chaotic updates<BR>or inserts or deletes where several people do these from different places almost simultaneously. To prevent that happening, we need to add BeginTrans and CommitTrans before and<BR>after the code that does update/ insert/ delete into the database. Once,we do that, when someone is doing the update, someone else who is trying to do the same thing will be "disabled" until The the first person finishes updating.<BR>Thus things become in order as it acts like a switch that will<BR>enable and disable our action temporarily to update data.<BR><BR>It is simple to use BeginTrans and CommitTrans as only 3 steps<BR>needed:<BR>Assuming you&#039ve set up a connection Conn:<BR>1. Conn.BeginTrans <BR> (start a transaction)<BR>2. Conn.Execute("UPDATE tablename SET fieldname = .... etc ")<BR> or<BR> Conn.Execute("INSERT INTO ......")<BR> or <BR> Conn.Execute("DELETE ...........")<BR> <BR> which is the code for Updating or Inserting or Deleting data<BR> into the database<BR>3. Conn.CommitTrans <BR> (Commit the transaction)<BR><BR><BR>John Weeflaar

Posting Permissions

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