G
Guest
I'm having problems using breakpoints with Visual Basic .Net. Breakpoints
work until I excute certain commands. If I set a breakpoint above the
odtrVBDataReader = .ExecuteReader()
statement in the example below it works fine. Any breakpoint after the
statement won't be hit. The code executes as expected, it just won't stop at
the breakpoints. Also if I single-step to the command above, when it is
executed I get the "There is no source code available for the current
location." pop-up. The code below shows an example:
Public Sub Testsub()
Dim Test As String
Dim strVBConn As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "User ID=Admin;" _
& "Data Source=""(path)\File"""
Dim ocmdVBCommand As OleDbCommand
Dim odtrVBDataReader As OleDbDataReader
Try
ocmdVBCommand = New OleDbCommand
With ocmdVBCommand
.Connection = New OleDbConnection(strVBConn)
.Connection.Open()
.CommandText = "Select Account, PaidBy From Table"
-> odtrVBDataReader = .ExecuteReader() ' Break points above
this work.
End With
Do While odtrVBDataReader.Read
Test = odtrVBDataReader.GetString(1)
Loop
Catch oexpData As OleDb.OleDbException
Exit Sub
End Try
odtrVBDataReader.Close()
ocmdVBCommand.Connection.Close()
End Sub
Any help would be appreciated.
Thanks,
Rick
work until I excute certain commands. If I set a breakpoint above the
odtrVBDataReader = .ExecuteReader()
statement in the example below it works fine. Any breakpoint after the
statement won't be hit. The code executes as expected, it just won't stop at
the breakpoints. Also if I single-step to the command above, when it is
executed I get the "There is no source code available for the current
location." pop-up. The code below shows an example:
Public Sub Testsub()
Dim Test As String
Dim strVBConn As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "User ID=Admin;" _
& "Data Source=""(path)\File"""
Dim ocmdVBCommand As OleDbCommand
Dim odtrVBDataReader As OleDbDataReader
Try
ocmdVBCommand = New OleDbCommand
With ocmdVBCommand
.Connection = New OleDbConnection(strVBConn)
.Connection.Open()
.CommandText = "Select Account, PaidBy From Table"
-> odtrVBDataReader = .ExecuteReader() ' Break points above
this work.
End With
Do While odtrVBDataReader.Read
Test = odtrVBDataReader.GetString(1)
Loop
Catch oexpData As OleDb.OleDbException
Exit Sub
End Try
odtrVBDataReader.Close()
ocmdVBCommand.Connection.Close()
End Sub
Any help would be appreciated.
Thanks,
Rick