Results 1 to 9 of 9

Thread: Application Crash with no Exception Thrown

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2019
    Posts
    3

    Application Crash with no Exception Thrown

    Good day,

    My program is crashing and no exception is being thrown,

    I get this message:

    Unhandled exception at 0x56e25468 (tiptsf.dll) in Stock Monitor CONS.exe: 0xC0000005: Access violation writing location 0x769248d1.

    Dissassembly: 56E25468 mov dword ptr [eax+8],ebx

    I believe it has to do with this symbol:

    tiptsf.dll C:\Program Files (x86)\Common Files\Microsoft Shared\Ink\tiptsf.dll N/A N/A Symbols loaded (source information stripped). C:\Users\xxx\Documents\SymbolCache\tiptsf.pdb\35FBF03EC4314EE7A4CA9389BCDE8D192\tiptsf.pdb 99 6.2.9200.16384 (win8_rtm.120725-1247) 7/26/2012 1:41 AM 56E20000-56E89000 [8896] Stock Monitor CONS.exe: Native

    Im not sure why this symbol module is required in the first place, from what I looked up tiptsf.dll has to do with windows tablet or something like that.

    Any help on the issue ? I've scoured the web for the past five days but no one comes close to solving the issue.


    ---


    Sorry I added code but forum moderation prevented me from posting a second message.

    The following leave event causes the crash to occur, only after I've clicked btn_StockOnJobs(click event)

    So I'll click btn_StockOnJobs:

    Code:
     Private Sub btn_StockOnJobs_Click(sender As Object, e As EventArgs) Handles btn_StockOnJobs.Click
    'Populate datagridview from db
            Try
                'DataGridView1.DataSource.Clear()
                Dim connectionString As String
                'Dim connection As OleDbConnection
                Dim ds_stockonjobs As New DataSet
                Dim sql As String
                connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\xxx\Documents\Stock Management CONS\CONSdb1.accdb"
                Using connection = New OleDbConnection(connectionString)
                    sql = "SELECT StockOnJobs.JobNumber,StockOnJobs.Warehouse, StockOnJobs.StockCode, StockCodes.Description, StockOnJobs.Quantity, StockOnJobs.DateIssued" &
                         " FROM StockOnJobs" &
                         " INNER JOIN StockCodes ON" &
                         " StockOnJobs.StockCode = StockCodes.StockCode"
    
                    connection.Open()
                    Using oledbAdapter = New OleDbDataAdapter(sql, connectionString)
                        If connection.State <> ConnectionState.Closed Then
                            connection.Close()
                        End If
    
                        oledbAdapter.Fill(ds_stockonjobs)
                    End Using
                End Using
                DataGridView1.DataSource = ds_stockonjobs.Tables(0)
                DataGridView1.AutoGenerateColumns = True
    
            Catch ex As Exception
                MsgBox(ex.Message)
            Finally
                MsgBox("test")
            End Try
    
    
        End Sub
    Then I'll open up a new form with this button:

    Code:
     Private Sub btn_IssueStock_Click(sender As Object, e As EventArgs) Handles btn_IssueStock.Click
            Try
                Dim frm_IssueStock As New frm_IssueStock
                frm_IssueStock.ShowDialog()
                frm_IssueStock.Focus()
    
            Catch ex As Exception
                MsgBox(ex.Message)
            Finally
                MsgBox("test")
            End Try
    
        End Sub
    Once the new form is open I've a txt_JobNumber_Leave event that checks to see if the value within txt_JobNumber exists in the DB and if it does then populate the datagridview in the new form.

    Code:
     Private Sub txt_JobNumber_Leave(sender As Object, e As EventArgs) Handles txt_JobNumber.Leave
            Try
                verify_Job_Number_Exists()
                refresh_Grid()
            Catch ex As Exception
                MsgBox(ex.Message)
            Finally
                MsgBox("Job Number Entered")
            End Try
    
        End Sub
    verify_Job_Number_Exists()
    Code:
     Private Sub verify_Job_Number_Exists()
    
            Try
                Dim commandText = "SELECT JobNumber FROM StockOnJobs"
                If Len(txt_JobNumber.Text) >= 8 Then
                    Dim connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\xxx\Documents\Stock Management CONS\CONSdb1.accdb"
                    Using connection = New OleDbConnection(connectionString)
                        Using sel = New OleDbCommand(commandText, connection)
                            Try
                                connection.Open()
    
                                Try
                                    Dim count As String = sel.ExecuteScalar
                                    If count = "" Then
                                        JobNum_Exists = 0
                                    Else
                                        JobNum_Exists = 1
    
                                    End If
                                Catch Ex As InvalidOperationException
                                    MsgBox(Ex.Message)
                                Catch ex As FormatException
                                    MsgBox(ex.Message)
                                Catch ex As InvalidCastException
                                    MsgBox(ex.Message)
                                Catch ex As OverflowException
                                    MsgBox(ex.Message)
                                End Try
                            Catch ex As OleDbException
                                MsgBox(ex.Message)
                            Catch ex As InvalidOperationException
                                MsgBox(ex.Message)
                            End Try
                        End Using
                        If connection.State <> ConnectionState.Closed Then
                            connection.Close()
                        End If
                    End Using
                End If
    
    
    
            Catch Ex As OleDbException
                MsgBox(Ex.Message)
            Finally
                MsgBox("test")
            End Try
    
        End Sub
    refresh_Grid()
    Code:
      Private Sub refresh_Grid()
            Try
                If txt_JobNumber.Text = "" Then
                    End
                Else
    
                    If JobNum_Exists = 1 Then
                        txt_JobNumber.Enabled = False
    
                        Dim connectionString As String
    
                        Dim ds As New DataSet
                        Dim sql As String
                        connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\xxx\Documents\Stock Management CONS\CONSdb1.accdb"
                        Using connection = New OleDbConnection(connectionString)
                            ' sql = "SELECT * FROM StockOnJobs WHERE JobNumber = @JobNumber"
                            sql = "SELECT * FROM StockOnJobs WHERE JobNumber = '" & txt_JobNumber.Text & "'"
                            'Using sel = New OleDbCommand(sql, connection)
                            connection.Open()
                            'sel.Parameters.Add("@JobNumber", txt_JobNumber.Text)
                            Using oledbAdapter = New OleDbDataAdapter(sql, connectionString)
    
    
                                oledbAdapter.Fill(ds)
                                lbl_Noti.DataSource = ds.Tables(0)
                                lbl_Noti.AutoGenerateColumns = True
                                'End Using
                                If connection.State <> ConnectionState.Closed Then
                                    connection.Close()
                                End If
    
                            End Using
                            ds.Dispose()
                        End Using
    
                        'Default Column Width
    
                        'dgv_JobStock.Columns("CurrentPrice").Width = "70"
    
    
                        'Minimum Width
                        'dgv_JobStock.Columns("CurrentPrice").MinimumWidth = "70"
    
                    End If
                End If
                'See if Job Number exists
    
    
            Catch ex As Exception
                MsgBox(ex.Message)
            Finally
                MsgBox("test")
            End Try
        End Sub
    I only recently started coding in vb.net again, I'm coding towards creating a product that will make my manual tasks easier, which means I'm not really investing time in understanding everything that's being coded, I didn't take exception handling into consideration from the start, had to add the handling afterwards.

    One thing I'd like to find out that's not entirely relevant to this brick wall of a problem, if I enclose an entire sub routine in a try catch statement, can I use individual catch statements for each different exception that functions may bring up ? instead of enclosing individual segments of code with try catch statements.
    Last edited by JosePat; Sep 18th, 2019 at 05:00 AM. Reason: update

  2. #2

    Thread Starter
    New Member
    Join Date
    Sep 2019
    Posts
    3

    Re: Application Crash with no Exception Thrown

    Post Cleared.

    Post approval took a while so edited OP.
    Last edited by JosePat; Sep 18th, 2019 at 06:13 AM.

  3. #3
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,651

    Re: Application Crash with no Exception Thrown

    My program is crashing and no exception is being thrown,
    Unhandled exception
    without seeing any of your code, my first question would be what error handling do you have in place? as as the message is telling you it appears that your not handling an error somewhere.

    Are you missing error handling in some methods? maybe ones that you dont expect to error ?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  4. #4
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,651

    Re: Application Crash with no Exception Thrown

    The following leave event causes the crash to occur, only after I've clicked btn_StockOnJobs(click event)
    I am assuming that you now know where the error is coming from because you added in the error handling, so now you know that the leave event is causing the error, what error message do you get?

    Why in the verify_Job_Number_Exists are you using oleDbException at the end instead of Exception which you are using everywhere else?

    Also what is lbl_Noti and where are you declaring it ?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2019
    Posts
    3

    Re: Application Crash with no Exception Thrown

    The error handling was in there from the start.

    I don't know what I did but the error has gone away. I might try to change things back one change at a time to see what it was, but I think it was when I changed the architecture from "all" or something like that to just x84.

    But I cant think that it was something in my code that was causing the issue because I tried to catch all the exceptions and none of them were reacting.

  6. #6
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,651

    Re: Application Crash with no Exception Thrown

    Ok its possible that its because your access database driver is 32 bit, and so when you choose x84 architecture your program will compile as 32 bit as well, where as All doesn't specify and so maybe it was compiling something as 64 bit which was causing an incompatibility.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  7. #7
    Junior Member
    Join Date
    Jul 2016
    Posts
    19

    Re: Application Crash with no Exception Thrown

    I've been looking into this as well and have found no resolution to this problem.

    My VB.net application is caused by the crashing module TIPTSF.dll. I have exception handlers in place but none has been successful in catching it. The problem is not reproducible and it happens on random occasions. I use OLEDB and the Microsoft Access Database Engine 2010 as well. Has the OP found a resolution for this problem? Thank you.

    Ian

  8. #8
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    107,442

    Re: Application Crash with no Exception Thrown

    Are you handling the UnhandledException event of your application? If not, you should be. That's where you catch exceptions that you didn't specifically predict, log them and then shut down gracefully instead of crashing.

  9. #9
    Junior Member
    Join Date
    Jul 2016
    Posts
    19

    Re: Application Crash with no Exception Thrown

    Quote Originally Posted by jmcilhinney View Post
    Are you handling the UnhandledException event of your application? If not, you should be. That's where you catch exceptions that you didn't specifically predict, log them and then shut down gracefully instead of crashing.

    Yes. That's the weird thing about this error. The application crashes bypassing all event handlers (Unhandled Exception). Plus, these crashes are hard to reproduce because they happen at different times and actions. I've looked into timers but it's not that either. They only happen on certain computers hence I'm thinking it's because of corrupt DLLS. I'm hoping the OP has some insight on how he took care of this problem if he already has.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width