Results 1 to 2 of 2

Thread: Weired goings on in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    7

    Weired goings on in VB

    I have got 2 strange issues occuring in Visual Studio VB6 SP6.
    first one is that I have a listview and i assign a tag to each item as shown bellow.
    VB Code:
    1. Dim rs As New ADODB.Recordset
    2. Dim conn As New ADODB.Connection
    3. Dim cmd As New ADODB.Command
    4. Dim Entry As ListItem
    5.  
    6. Counter = 0
    7.  
    8. conn.Open "DSN=kar;uid=admin;vb=;database=kar"
    9. Set cmd.ActiveConnection = conn
    10. cmd.CommandText = "SELECT * from Partz "
    11.  
    12. ListView2.ListItems.Clear
    13. With rs
    14.    .CursorLocation = adUseClient
    15.    .Open cmd, , adOpenStatic, adLockReadOnly
    16.    .MoveFirst
    17.    Do While Not .EOF
    18.          Set Entry = ListView2.ListItems.Add(, , .Fields(0))
    19.             Counter = Counter + 1
    20.             ListView2.ListItems(Counter).Tag = .Fields(11)
    21.             Entry.SubItems(1) = .Fields(6)
    22.             Entry.SubItems(2) = .Fields(5)
    23.    .MoveNext
    24.    Loop
    25. rs.Close
    26. conn.Close
    27. End With
    When I run the code on my pc at home it will pick up the tag when i click on the listview as the appropriate value, but when i run it at work it will produce the tag of the item as nothing.

    Secondly...

    When i load a form with a combo control it doesnt load the control correctly. It half paints the control with only the curser flashing. if you click on the control or press the down curser you can see the values in the combo box and then the form correctly draws the control.
    Any Ideas anyone...?

    Thanks
    Last edited by Hack; Mar 20th, 2006 at 06:57 AM. Reason: Added [vbcode] [/vbcode] tags for more clarity.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Weired goings on in VB

    Are you sure the database you are using at your home and at your work are the same? How about the dns?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

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