¤ Sure, here is the bit of code throwing the exception.
¤
¤ Try
¤ objCommand.CommandText = "INSERT INTO
¤ advancementHistory (agreementID, paymentReceivedDate, advanceAmount) VALUES
¤ (" & agreementID & ", #" & dtEditAdvanceReceived.Text & "#, '" &
¤ CorrectStrings(FormatNumber(CDbl(txtEditAdvance.Text), 2)) & "')"
¤ objCommand.ExecuteNonQuery()
¤ ''Initialize balance data
¤ Dim dblCurrentBalance As Double = 0
¤ objCommand.CommandText = "SELECT TOP 1 balanceID,
¤ currentBalance FROM currentBalance WHERE agreementID = " & agreementID
¤ objDR = objCommand.ExecuteReader
¤ If objDR.Read = True Then
¤ dblCurrentBalance = objDR.GetDecimal(1)
¤ ''Update current balance
¤ objCommand.CommandText = "UPDATE currentBalance
¤ SET currentBalance = '" & CorrectStrings(FormatNumber((dblCurrentBalance -
¤ CDbl(txtEditAdvance.Text)), 2)) & "' WHERE balanceID = " _
¤ & objDR.GetInt32(0)
¤ Else
¤ ''Insert record into current balance
¤ objCommand.CommandText = "INSERT INTO
¤ currentBalance (agreementID, currentBalance) VALUES (" & agreementID & ", '"
¤ & _
¤ CorrectStrings(FormatNumber((-1 *
¤ CDbl(txtEditAdvance.Text)), 2)) & "')"
¤ End If
¤ objDR.Close()
¤ objCommand.ExecuteNonQuery()
¤ Catch exp5 As Exception
¤ MessageBox.Show(exp5.Message, "Error Saving Advance
¤ Payment", MessageBoxButtons.OK, MessageBoxIcon.Error)
¤ myUpdater.DoError()
¤ bolSaveAborted = True
¤ End Try
¤
¤ The code works fine when I run if locally, but if we use the database over
¤ the network it gives the open/fetching error.
On which line does it fail and what is the error message?
Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)