Results 1 to 9 of 9

Thread: VB6 app gives run-time error 6 overflow

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    89

    VB6 app gives run-time error 6 overflow

    My VB6 app gives run-time error '6' overflow. It is simply passing results of several file searches to a listbox. It only crashes when hundreds of lines have been written to the listbox, performing fine if there are are not that many. Is there a limit to how many lines a listbox can handle?

    How can I trap this error and see what is causing it?

  2. #2
    Fanatic Member damasterjo's Avatar
    Join Date
    Nov 2005
    Location
    In front of my Comp DirectX7 EXpert
    Posts
    827

    Re: VB6 app gives run-time error 6 overflow

    you may have a variable set as a byte, then that variable if linked to the lines in the listbox would be overflowed at 255.

    Check it out and change it to a long or integer or something, and no listboxes can go VERY FAR.
    Software languages known:
    Qbasic - TI-Basic - Liberty Basic - Visual Basic 6
    Software API's known:
    Directx 7 and 8
    Internet languages, in the process of learning:
    HTML - JAVASCRIPT - PHP - CSS - MYSQL - AJAX

  3. #3
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    468

    Re: VB6 app gives run-time error 6 overflow

    There is a limit of 32,767 items. Exceeding that limit will generate the error you mentioned.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    89

    Re: VB6 app gives run-time error 6 overflow

    Will check out the variables.

    What constitutes an 'item' in a listbox?

  5. #5
    Hyperactive Member
    Join Date
    Jun 2004
    Posts
    468

    Re: VB6 app gives run-time error 6 overflow

    Quote Originally Posted by imperialdata
    What constitutes an 'item' in a listbox?
    Umm, an entry that was added using the AddItem method.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    89

    Re: VB6 app gives run-time error 6 overflow

    Daft question I suppose but was surprised to learn you could have 32,767 single characters or 32,767 large strings

  7. #7
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: VB6 app gives run-time error 6 overflow

    Quote Originally Posted by imperialdata
    My VB6 app gives run-time error '6' overflow. It is simply passing results of several file searches to a listbox. It only crashes when hundreds of lines have been written to the listbox, performing fine if there are are not that many. Is there a limit to how many lines a listbox can handle?

    How can I trap this error and see what is causing it?
    Use the listview control instead

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    89

    Re: VB6 app gives run-time error 6 overflow

    Can you explain why it's better Remix?

  9. #9
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: VB6 app gives run-time error 6 overflow

    Quote Originally Posted by imperialdata
    Can you explain why it's better Remix?
    It's a more robust control in that you can have more than 32,767 items and, if you need them you can have functional multiple columns and column headers, etc.

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