J
jimj
The line insertStatus = cmdInsert.ExecuteNonQuery() is hanging; although the
INSERT is working, because after I kill the application, I can see the new
row.
The OLE DB provider is set to IBM DB2 UDB for iSeries IBMDA400 OLE DB
Provider.
Private Function VS_Insert(ByVal pndAmt As Decimal) As Boolean
Dim currTime As String = Format(DateTime.Now, "HH.mm.ss")
Dim currDate As String = Format(DateTime.Now, "yyyy-MM-dd")
Dim success As Boolean = False
Dim cnInsert As New OleDb.OleDbConnection(My.Settings.connAS400)
Dim cmdInsert As New OleDb.OleDbCommand
Dim insertStatus As Integer = 0
cmdInsert.Parameters.Clear()
Dim query As String = "INSERT INTO PRODUCTION.DVABDAPV " & _
"(PONBR, LINENR) " & _
"VALUES (?,?)"
With cmdInsert
.CommandText = query
.CommandType = CommandType.Text
.Parameters.Add("?", OleDb.OleDbType.Char).Value = PONr
.Parameters.Add("?", OleDb.OleDbType.Char).Value = lineNr
.Connection = cnInsert
End With
handleConnection(cnInsert)
insertStatus = cmdInsert.ExecuteNonQuery()
If Not insertStatus = 0 Then
MsgBox("The select failed")
success = False
Else
MsgBox("The select WORKED")
success = True
End If
handleConnection(cnInsert)
Return (success)
INSERT is working, because after I kill the application, I can see the new
row.
The OLE DB provider is set to IBM DB2 UDB for iSeries IBMDA400 OLE DB
Provider.
Private Function VS_Insert(ByVal pndAmt As Decimal) As Boolean
Dim currTime As String = Format(DateTime.Now, "HH.mm.ss")
Dim currDate As String = Format(DateTime.Now, "yyyy-MM-dd")
Dim success As Boolean = False
Dim cnInsert As New OleDb.OleDbConnection(My.Settings.connAS400)
Dim cmdInsert As New OleDb.OleDbCommand
Dim insertStatus As Integer = 0
cmdInsert.Parameters.Clear()
Dim query As String = "INSERT INTO PRODUCTION.DVABDAPV " & _
"(PONBR, LINENR) " & _
"VALUES (?,?)"
With cmdInsert
.CommandText = query
.CommandType = CommandType.Text
.Parameters.Add("?", OleDb.OleDbType.Char).Value = PONr
.Parameters.Add("?", OleDb.OleDbType.Char).Value = lineNr
.Connection = cnInsert
End With
handleConnection(cnInsert)
insertStatus = cmdInsert.ExecuteNonQuery()
If Not insertStatus = 0 Then
MsgBox("The select failed")
success = False
Else
MsgBox("The select WORKED")
success = True
End If
handleConnection(cnInsert)
Return (success)