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. Transaction AS400

Transaction AS400

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdatabasequestion
6 Posts 5 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.
  • H Offline
    H Offline
    helelark123
    wrote on last edited by
    #1

    Hello, Is it possible to use vb.net transactions with connection to AS400? Here is a snippet: objConn.Open() ' Make the transaction. Dim trans As Odbc.OdbcTransaction = _ objConn.BeginTransaction(IsolationLevel.ReadCommitted) ' Make a Command for this connection ' and this transaction. Dim cmd As New Odbc.OdbcCommand( _ "UPDATE AUTCTRL SET CTLNM=? WHERE CTLNM=?", _ objConn, _ trans) ' Create parameters for the first command. cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtFirstName1.Text)) cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtLastName1.Text)) ' Execute the second command. cmd.ExecuteNonQuery() '(1) BUG IN THIS LINE ' Create parameters for the second command. cmd.Parameters.Clear() cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtFirstName2.Text)) cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtLastName2.Text)) ' Execute the second command. cmd.ExecuteNonQuery() ' Commit the transaction. trans.Commit() ' Close the connection. objConn.Close() '(1): ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL7008 - AUTCTRL in RAVONLIBT not valid for operation. Thank you

    Shay Noy

    A K W 3 Replies Last reply
    0
    • H helelark123

      Hello, Is it possible to use vb.net transactions with connection to AS400? Here is a snippet: objConn.Open() ' Make the transaction. Dim trans As Odbc.OdbcTransaction = _ objConn.BeginTransaction(IsolationLevel.ReadCommitted) ' Make a Command for this connection ' and this transaction. Dim cmd As New Odbc.OdbcCommand( _ "UPDATE AUTCTRL SET CTLNM=? WHERE CTLNM=?", _ objConn, _ trans) ' Create parameters for the first command. cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtFirstName1.Text)) cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtLastName1.Text)) ' Execute the second command. cmd.ExecuteNonQuery() '(1) BUG IN THIS LINE ' Create parameters for the second command. cmd.Parameters.Clear() cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtFirstName2.Text)) cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtLastName2.Text)) ' Execute the second command. cmd.ExecuteNonQuery() ' Commit the transaction. trans.Commit() ' Close the connection. objConn.Close() '(1): ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL7008 - AUTCTRL in RAVONLIBT not valid for operation. Thank you

      Shay Noy

      A Offline
      A Offline
      Ashfield
      wrote on last edited by
      #2

      As far as I know, AS400 is a type of IBM computer, not a database. I assume you have a database on there (as you have a connection), so I expect the database either supports these types of transactions or, by the error message, more likely it doesn't. In a nutshell, check your database documentation. Hope this helps

      Bob Ashfield Consultants Ltd

      M 1 Reply Last reply
      0
      • A Ashfield

        As far as I know, AS400 is a type of IBM computer, not a database. I assume you have a database on there (as you have a connection), so I expect the database either supports these types of transactions or, by the error message, more likely it doesn't. In a nutshell, check your database documentation. Hope this helps

        Bob Ashfield Consultants Ltd

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        I wonder if it is DB2. The only time I used AS400 stuff it was a cobol type environment I think but that was in the 90's.

        Never underestimate the power of human stupidity RAH

        W 1 Reply Last reply
        0
        • H helelark123

          Hello, Is it possible to use vb.net transactions with connection to AS400? Here is a snippet: objConn.Open() ' Make the transaction. Dim trans As Odbc.OdbcTransaction = _ objConn.BeginTransaction(IsolationLevel.ReadCommitted) ' Make a Command for this connection ' and this transaction. Dim cmd As New Odbc.OdbcCommand( _ "UPDATE AUTCTRL SET CTLNM=? WHERE CTLNM=?", _ objConn, _ trans) ' Create parameters for the first command. cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtFirstName1.Text)) cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtLastName1.Text)) ' Execute the second command. cmd.ExecuteNonQuery() '(1) BUG IN THIS LINE ' Create parameters for the second command. cmd.Parameters.Clear() cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtFirstName2.Text)) cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtLastName2.Text)) ' Execute the second command. cmd.ExecuteNonQuery() ' Commit the transaction. trans.Commit() ' Close the connection. objConn.Close() '(1): ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL7008 - AUTCTRL in RAVONLIBT not valid for operation. Thank you

          Shay Noy

          K Offline
          K Offline
          Kschuler
          wrote on last edited by
          #4

          Try this[^]. Or try a google search[^]. Hope this helps.

          1 Reply Last reply
          0
          • M Mycroft Holmes

            I wonder if it is DB2. The only time I used AS400 stuff it was a cobol type environment I think but that was in the 90's.

            Never underestimate the power of human stupidity RAH

            W Offline
            W Offline
            Wendelius
            wrote on last edited by
            #5

            It's DB2.

            The need to optimize rises from a bad design

            1 Reply Last reply
            0
            • H helelark123

              Hello, Is it possible to use vb.net transactions with connection to AS400? Here is a snippet: objConn.Open() ' Make the transaction. Dim trans As Odbc.OdbcTransaction = _ objConn.BeginTransaction(IsolationLevel.ReadCommitted) ' Make a Command for this connection ' and this transaction. Dim cmd As New Odbc.OdbcCommand( _ "UPDATE AUTCTRL SET CTLNM=? WHERE CTLNM=?", _ objConn, _ trans) ' Create parameters for the first command. cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtFirstName1.Text)) cmd.Parameters.Add(New Odbc.OdbcParameter("CTLNM", txtLastName1.Text)) ' Execute the second command. cmd.ExecuteNonQuery() '(1) BUG IN THIS LINE ' Create parameters for the second command. cmd.Parameters.Clear() cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtFirstName2.Text)) cmd.Parameters.Add(New OleDb.OleDbParameter("CTLNM", txtLastName2.Text)) ' Execute the second command. cmd.ExecuteNonQuery() ' Commit the transaction. trans.Commit() ' Close the connection. objConn.Close() '(1): ERROR [HY000] [IBM][Client Access Express ODBC Driver (32-bit)][DB2/400 SQL]SQL7008 - AUTCTRL in RAVONLIBT not valid for operation. Thank you

              Shay Noy

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              Have a look at this: Error SQL7008 while updating a DB2/400 table[^]

              The need to optimize rises from a bad design

              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