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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

program on a network

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I've written a small program that uses data$.dat to hold/read data. The program is saved on one of 3 networked computers, and when I run it, it gives an error when the data file is needed. It runs fine on the machine that the actual file is on, though. Any ideas?
 
I think (I'm not sure) this is because you are specifiying the full filename path in the program, and when you run the computer through the network, QBasic uses the paths from the computer it's currently running on.

Therefore, unless the file exists on the computer that is calling it over the network, the program can't find the file.

Perhaps (once again I'm not sure) if you use a path that is relitive to the QBasic program on the host computer... like in the same directory on in a subdirectory...

I don't think that QBasic can handle network paths, but if it can, you should be able to use those. Does anyone know if QB can handle network paths?
 
Two possible explanations:

------------------------------------------------------------
You didn't specify the network directory. One thing you can try is setting up a path in the logon.bat file to include the path.

EX:

net use q: \\servername\object-unit

this way, when you go to dos and type in Q:. It will be the directory listed. It is similar to SUBST command.

Say your DAT file is on the server "myserv" in the shared folder called "QBRules". You may want to use:

net use q: \\myserv\qbrules

this will "make" (for the sake of argument) a "Q:" drive.

If your program is to be running from one location, you should create shortcuts pointing to this "Q:" drive and your OPEN statements should have been setup to use the relative paths as suggested above...see the following example:


ListSet$ = ".\bas\250games.lst"
OPEN ListSet$ FOR INPUT AS 1
(notice the bold section??)


If Each station is to have a copy of the EXE file but the data file is centerally stored, then code your program to look for the data on that drive--if Error occurs 1) user not logged on, 2)Logon script may have been changed, or 3) data file has been moved.
----------------------------------------------------------

The 1 of 3 networked computer is not shared. Depending on your setup, the directory (folder) needs to be shared so that others have access to the files listed within that directory. THEN, you can code the logon script as mentioned earlier.

--MiggyD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top