Results 1 to 7 of 7

Thread: Update multiple records in same session

  1. #1
    Join Date
    May 2005
    Posts
    3

    Update multiple records in same session

    When I choose to update the first record, the record is updated but when I select another record to update, the debug shows the first record in the <where> statement. And of course the update does not complete. I suspect there is a quick solution to my problem. Any help Please!!

  2. #2
    Join Date
    Oct 2002
    Posts
    933
    Classic or Tornado? A small NWIND example code will help.

    FK

  3. #3
    Join Date
    May 2005
    Posts
    3
    Frank
    Here is the same code from a SQL Northwind, using shippers table.
    The where clause always keeps the first ID.

    <script language='vb' runat='server'>
    'Generated by Tornado Designer - May-25-05 14:26
    Sub Page_Load(Source as Object, E as EventArgs)
    Dim GD As New Tornado.Getdata()
    Dim b As New Tornado.Z()
    b.dbDBType="SQL"
    b.dbDSN="NWINDSQL"
    b.dbSQL="SELECT * FROM Shippers"
    b.dbSkin="type=Summermeadow"
    b.dbUnit="101"
    b.dbPagesize=-1
    b.dbMode="ty=Grid| indexfld=ShipperID"
    b.dbdebug="EditAction"
    b.dbNavigationItem="b5,Add,Update,Delete"
    b.dbBookMark="Shippers;0"
    b.dbEditUpdateFlds="Fi=CompanyName|Ty=Text"
    b.dbEditAddFlds="Fi=CompanyName|Ty=Text"
    b.dbTextHolder = "title=Test"
    b.ASPdbNet
    End Sub
    </Script>

  4. #4
    Join Date
    Oct 2002
    Posts
    933
    I cut and paste and test your code and cannot spot the problem. Send me an email frank@aspdb.com and I'll send you the test code and screen dump.


    Frank

  5. #5
    Join Date
    Oct 2002
    Posts
    933
    Doug,
    Re you all set wit this problem? get the latest version and test the code and it should work. If not then email me.


    Frank

  6. #6
    Join Date
    May 2005
    Posts
    3
    Frank,
    The version I use is 12/22/2003.
    Here is a detailed explaination of the problem.
    "Using the code above....
    I can update one record with no problem, but when I attempt to update a second record (in the same session), the WHERE clause (in this case ShipperID field) doesn't change to the new ShipperID and the result is the wrong record is updated. The only way I can make this work is to exit the application and then open it again to update another record.

  7. #7
    Join Date
    Oct 2002
    Posts
    933
    Get the latest one or send me you id file and I 'll send you the "latest - latest". Try that on the side to make sure nothing is broken - 2003 version is pretty old. The sample code works on the latest version.

    FK

Posting Permissions

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