Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 771
  • Last Modified:

Limit on the Capacity of OpenDialog Component in Delphi 7


I am trying to use the OpenDialog component to open a large number of text files (i.e.several thousands). Actaully, the OpenDialog component is used to load the names of text files into a grid, then I parse the text files and load them into a database. When I select the a large number of files, the OpenDialog complains that it cannot find a file because the file name gets truncated. My hunch is that the number of file names excced the some capacity limit on how many "items" the Opendialog can hold. Is there a such limit? If so, any suggestions on getting around the problem? Thanks!

1 Solution
the limit I think is 65,000~ characters (for MultiSelect = True)

a work around would be to write your own OpenDialog...
Put the filenames into a Table, then use a table oriented control such as DBGrid to choose the filename which instigates the parsing and loading of the content of the file into your database.
Maybe you should consider a different approach - like have the user choose a directory or path mask (c:\path\*.txt). Having the user select thousands of files in an open file dialog sounds like bad UI Design.
shinhwAuthor Commented:
Thanks for you answers!

Yes, I think we are running into the limit as BlackTigerX suggested.

We are actually using the OpenDialog to get the file names and loading them in a DBGrid. So, we can use the OpenDialog multiple times to populate the DBGrid until we grab all the files. The application's original intent was to load just a few files. But, the users have a one time requirement to load tens of thousands of files now. So, I think we can have the users load the files multiple times into the DBGrid, then parse the file onece.

Thanks for your assistance.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now