RollBacking is not happening in some client systems

Posted on 2007-08-01
Last Modified: 2013-11-25
my server os is windows 2003 standarad edition and we installed the sql server 2000 in the os with service pack 4.
our application is developed in visual basic 6.0 and converted as a package and installed in the client system
the problem is when saving the data from the client system it stores the record partially for example i want to store the record in 4 tables from the client system but when saving it stores the record in 2 tables only it is not storeing the record in other two tables
we gave rollback statement in the application but some client system it is rollbacking properly and some client system it is not roll backing the records properly and wise wersa when deleting the records from the client system
i checked the coding thoroughly but in some cases it is not roll backing properly so i need the answer to solve this problem kindly send me the reply to this
Question by:rsomasundar
    LVL 17

    Accepted Solution

    Hi rSomasundar,

    Can you make me clear whether you are inserting records line by line or you are using the "insert into " sql statement to insert records in the table.

    Before that let me give you a sugessition.

    Better you try to handle one boolean variable to check whether the updation is successful or not.

    For example please go through the code given below.

    private sub cmdsave_click()
    Dim updateprocess as boolean
    on error goto errhandler:
    begin transaction
      updateprocess = true
       sql1 = "insert into tablename1 and fieldvalues"
      connection.execute sql1
      if updateprocess = true then updateprocess = true

       sql2 = "insert into tablename2 and fieldvalues"
       connection.execute sql2
       if updateprocess = true then updateprocess = true

       sql3 = "insert into tablename3 and fieldvalues"
       connection.execute sql3
       if updateprocess = true then updateprocess = true

       sql4 = "insert into tablename4 and fieldvalues"
       connection.execute sql4
       if updateprocess = true then updateprocess = true
        if updateprocess = false then
               rollback trans
             commit trans
        end if
    exit sub

    updateprocess =false
    on error resume next
    LVL 2

    Author Comment

    Hi shasunder
    i am using the insert into sql statement to store the values in the table
    LVL 17

    Expert Comment

    by:Shanmuga Sundaram
    Hi rsomasundar,

    Then I hope that you can use the above mentioned ways to solve your issue

    d.Shanmuga sundaram
    LVL 2

    Author Comment

    Hi Shanmuga sundaram
    Thanks for your Reply
    My application was installed around 40 systems and at the same time 10 or 15 clients using my application and now the database is crossing 5.5gb so that when they are opening the application it is opening very slowly and retrieving the result set from the query also taking some time so that clients telling that that application is very slow
    i did the index tunning and other things but still it is very slow
    is there any way to increase my application speed kindly reply me

    soma sundar
    LVL 17

    Expert Comment

    by:Shanmuga Sundaram
    Hi rsomasundar,

    Try optimizing your queries in the program. And also confirm the cursor type which you use in your program.

    D.Shanmuga sundaram

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now