Strange Application exit

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Lux

    #1

    Strange Application exit

    I have built a query tool that lists a table structure in a list view along with a rich text box that I can run an adhoc query in. Inside the VS2003, it works fine. When I launch the same exe from a shortcut on XP pro, it connects, then looks like it's going to load the listview and then exits. There is no exception or error thrown. Fine, so I added some msg boxes trying to figure out where it's bombing. I get the message "before Read" and then nothing.

    The 2 connections hQuest, hQuest2 are regular connections to SqlBase and appear to be fine. What would cause it to run in development vs. not run from a shortcut? Would it be how I'm handling the readers? Would it be clearing the tv (that's the listview that I'm creating)? Basically rdr reads all the user created tables in from the database. Rdr2 then fetches the columns for that particular table and then adds the whole mess as a node.

    Thanks in advance.
    'This loads the listview..

    Dim myCommand As New SQLBaseCommand( "select name from sysadm.systable s where name not like 'SYS%' ", hQuest)

    Dim comFindColName As New SQLBaseCommand

    Dim rdr2 As SQLBaseDataRead er

    Dim rdr As SQLBaseDataRead er = myCommand.Execu teReader

    tv1.Nodes.Clear ()

    MsgBox("before read")

    Do While rdr.Read

    Dim tblnm As New TreeNode

    'n.Text = rdr.GetString(0 )

    tblnm.Text = rdr.Item("name" )

    comFindColName. CommandText = "select name " & _

    "from sysadm.syscolum ns where tbname = '" & tblnm.Text & "' order by colno"

    comFindColName. Connection = hQuest2

    rdr2 = comFindColName. ExecuteReader

    Do While rdr2.Read

    Dim colmn As New TreeNode

    colmn.Text = rdr2.Item("name ")

    tblnm.Nodes.Add (colmn)

    Loop

    tv1.Nodes.Add(t blnm)

    rdr2.Close()

    Loop

    rdr.Close()

Working...