Solved

Problem with the codes

Posted on 2014-12-17
5
59 Views
Last Modified: 2014-12-19
Hi,
It did go to frmAddDB.Show() below
    Private Sub TxtIteID_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TxtIteID.LostFocus
        Dim Myconn As New OleDb.OleDbConnection
        Dim Objconfig As New Config
        If Me.TxtIteID.Text <> "" Then
            Try
                If ObjLogin.ValidID(Me.TxtIteID.Text) Then
                    With Me.cmbUnit
                        .Items.Clear()
                        For Each Dr As DataRow In ObjLogin.LoadBrIte(TxtIteID.Text).Rows
                            .Items.Add(Dr(0).ToString)
                        Next
                        .SelectedIndex = 0
                    End With
                Else
                    MsgBox("It is not Valid Iteid", MsgBoxStyle.OkOnly)
                End If
            Catch
                frmAddDB.Show()
            End Try
            ...

Open in new window

           
when running the project, while I've just put one ID to IteID Textbox, and I want to know why.
0
Comment
Question by:HuaMinChen
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
Comment Utility
Is your question why line 18 is called?
If it is, then your code is raising an exception, the issue is you do not have enough details, thus please modify lines 17 to 20 as follows:
Catch ex As Exception
        ' Show the exception's message.
        MessageBox.Show(ex.Message)
        ' Show the stack trace, which is a list of methods 
        ' that are currently executing.
        MessageBox.Show("Stack Trace: " & vbCrLf & ex.StackTrace)
       frmAddDB.Show()
End Try

Open in new window

The first message box provide the exception reason (message) and the second message box the stack trace with location of the exception.
0
 
LVL 10

Author Comment

by:HuaMinChen
Comment Utility
Many thanks.

"PC326VM01\SSEXPR12" is the server name, which I use to login local Sql server DB, using management studio.

Is it fine that I put this below
<DBServer>PC326VM01\SSEXPR12</DBServer>
...

Open in new window


within Config.xml file fo the project?
0
 
LVL 10

Author Comment

by:HuaMinChen
Comment Utility
And I can use that name to login local Sql DB fine.
0
 
LVL 10

Author Comment

by:HuaMinChen
Comment Utility
Any other help to this?
0
 
LVL 35

Expert Comment

by:Miguel Oz
Comment Utility
Your last post is a new question, you should open a new question next time.
I am not sure how you are using DBServer element value,
for SQL server connection strings your post should be OK.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now