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