Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have an old DOS BASED program whi

Status
Not open for further replies.

wncads

Vendor
Nov 1, 1999
181
US
I have an old DOS BASED program which I need to install on a WIN98se machine and run. I have used the following line
in the AUTOEXEC.BAT file to create a shared drive for the other network machines to see.

subst x: c:\cca7

This creates the drive letter just as on the previous machine.. but when running it stops with an error that there are too many files open when in fact there are not??? any ideas??? Keith Buchanan
AplusNetworking.com
Commercial I.T. Networking & Wiring Specialist
keith@aplusnetworking.com
 
Keith,

Is that files or file handles?

Does it pertain to ISAM tables?

reghakr
 
The program is set to Prevent MS-Dos progs from det windows, and suggest MS-dos as necessary..

The program launches okay but then if i choose an option such as view members (its a program for keeping memberships and information on customers) the message comes up saying,

Error : Too many files open,
command : Too many files open.
Program: Procedure CLOSEOPEN x:\cca.exe

Certain things open such as the staff file but the main file of members is not opening.. Keith Buchanan
AplusNetworking.com
Commercial I.T. Networking & Wiring Specialist
keith@aplusnetworking.com
 
Keith,

So it must be a database. Two articles for you:

Maximum Number of ISAM Files Open at One Time in VB for MS-DOS

------------------------------------------------------------
The information in this article applies to:

Microsoft Visual Basic for MS-DOS 1.0
Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2, versions 7.0, 7.1

------------------------------------------------------------

SUMMARY
The number of ISAM tables that you can have open at one time is determined by the number of database files that you have open. (See table below for more information.)

The maximum number of database files that you can have open at one time is 4 files. However, this is not the maximum number of tables you can have open at one time. The maximum number of tables that you can have open at one time is 13 tables in 1 database file, 10 tables in 2 database files, 7 tables in 3 database files, or 4 tables in 4 database files.

If you attempt to open more than the maximum allowed number of tables or database files at one time, error 67, "Too many files" is returned.

A database file in the Professional Edition of Microsoft Visual Basic for MS-DOS, version 1.0; or in Microsoft Basic Professional Development System (PDS) for MS-DOS, versions 7.0 or 7.1 is created with the default extension .MDB and contains the physical data for each table plus the indexes used to define and point to the data.

The information in this article is included with the Help file provided with the Professional Edition of Microsoft Visual Basic for MS-DOS, version 1.0.


MORE INFORMATION
The ISAM engine in Microsoft Visual Basic for MS-DOS, version 1.0 and Microsoft Basic PDS for MS-DOS, versions 7.0 and 7.1 has a maximum number of 16 pointers or ISAM handles that it can use with ISAM files. These are NOT the same as MS-DOS file handles.

Each file still takes one MS-DOS file handle for its first open, but it does not need any additional MS-DOS file handles for additional tables opened in the same database file.

Each database file takes four ISAM handles on its initial open: one handle for the file, one for the indexes, one for the data, and one for the initial table. Each additional table referenced in an already opened database takes only one additional ISAM handle and no more MS-DOS handles. This is because ISAM handles that point to the same file, indexes, and data already exist.

As a result, the number of tables that you can have open at one time is determined by the number of database files you are using. The following table lists the combinations of databases (.MDBs) and additional ISAM tables that you can have open at one time:

Maximum Number of ISAM Files and Tables

---------------------------------------------------------
# of .MDBs (files): | 1 2 3 4
|
# of additional |
tables in already | 12 8 4 0
opened .MDBs: |
|
Total tables: | 13 10 7 4
|
|
Total ISAM handles: | 16 16 16 16
---------------------------------------------------------
Therefore, if you have all of your tables in only 1 database file, you can open a total of 13 tables at one time. However, if you open tables in 4 database files, you can only open those 4 tables at one time.

This information is taken from Page 145 of the "Microsoft Visual Basic for MS-DOS Professional Edition Features" manual for version 1.0; and from Page 388 (Chapter 10, "Database Programming with ISAM") of the "Microsoft Basic 7.0: Programmer's Guide" for versions 7.0 and 7.1.

============================================================


ISAM Files Open at Once, "Too Many Files" Error 67, Correction

------------------------------------------------------------
The information in this article applies to:

Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2, versions 7.0, 7.1

------------------------------------------------------------

SUMMARY
Page 673 of the "Microsoft Basic 7.0: Language Reference" (under the "Too many files" error in Appendix D) incorrectly states that ISAM is limited to opening 12 databases at once.

This should be corrected to read as follows:

At run time, the "Too many files" error may occur because:

ISAM has a limit to the number of databases and tables that can be open at one time and your program has exceeded this limit. The maximum number of database files that you can have open at once is four. Also, the maximum number of tables that you can have open at once is 13 tables in one database file, or 10 tables in 2 database files, or 7 tables in 3 database files, or 4 tables in 4 database files.
This information applies to Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 for MS-DOS and 7.10 for MS OS/2.


REFERENCES
An ISAM database file in Microsoft Basic Professional Development System (PDS) version 7.00 or 7.10 is created with the default extension .MDB and contains the physical data for each table plus the indexes used to define and point to the data.

(This correct ISAM information is taken from page 388 of the "Microsoft Basic 7.0: Programmer's Guide" for versions 7.00 and 7.10 [Chapter 10, "Database Programming with ISAM"].)

Additional query words: BasicCom

reghakr
 
I know this sounds silly but do you have a line in your config.sys file that sets the files to a particular limit? (ie. Files=XXX) If not, try adding a Files=200 to the Config.sys file and see if your error goes away. Ah, good old DOS. Let us know how it goes.
 
Thanks guys, I had tried the Files= in config.sys right after i sent this thread, and that fixed the problem... i knew that it should be there and forgot to post the solution... thanks anyway.. Keith Buchanan
AplusNetworking.com
Commercial I.T. Networking & Wiring Specialist
keith@aplusnetworking.com
 
VAULT you hit the nail on the head... Keith Buchanan
AplusNetworking.com
Commercial I.T. Networking & Wiring Specialist
keith@aplusnetworking.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top