I have a button to update Record. When I press it 2 or 3 times in a row it gives me the following error:
System.Data.OleDb.OleDbException: 'Unspecified error' ErrorCode -2147467259 Integer
the button calls an update routine as below
Public Sub UpdateREcord(ByVal lPartID As Long, ByVal sPartName As String,....im passing 60 variables)
Dim myConn As New OleDbConnection
myConn = Provider.OleConnectDB
Dim cmdUpdate As New OleDbCommand("Update EstParts ......all 60 fields WHERE [PartID]=" & lPartID & "", myConn)
cmdUpdate.ExecuteNonQuery()
myConn.Close()
Is it because its a lot of fields? Is it because I press update several times in a row?
here is the connection string
Public Function OleConnectEstimateDB() As OleDbConnection
Dim oleConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyDatabasePathAndName)
If oleConn.State = ConnectionState.Closed Then oleConn.Open()
Return oleConn
oleConn.Close()
End Function
This error only happens if I press update several times in a row