5 Replies - 12644 Views - Last Post: 14 January 2013 - 06:00 PM Rate Topic: -----

#1 joewillie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 12-January 07

run time error 53 - file not found

Posted 07 January 2013 - 06:03 PM

vb6 program (XP SP3)won't run in design mode - get "run time error 53 - file not found" pop-up. Have checked spelling of file and in the open statement. the file is in the same directory as the program. never had this problem before. error always occurs at
 Open "113Data.txt" For Input As #1  
which is the first thing the program does.

I can put a vb2010 program data file name (which is in a different directory) in the above open statement and it will go get it and load it with no problem.

All I have been able to find is that a .dll file is missing or corrupted, but no hint as to which .dll or where it is located or what to do about it.

I'm an old rookie. I'm using VB6 because the vb2010 program I wrote for my wife's desktop (XP SP3)won't load on her laptop (XP SP3) because of "no certified jit debugger" although it has the required .NET platform installed. If you could help me on this one the VB6 question won't be critical, although I would still like to know about the error 53 problem.

Thanks for anything you can share.

Joe Willie

Is This A Good Question/Topic? 0
  • +

Replies To: run time error 53 - file not found

#2 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: run time error 53 - file not found

Posted 08 January 2013 - 08:59 AM

Its possible to put non-printing characters in a file name.
Maybe a test function to retrieve all the file names from the application directory, then example them as a byte[] to see if there is something hinky going on.

Or just rename the file in Windows Explorer so you know its not odd, then try again with the new name.

As for the VB2010 version - I'm not much on VB, but perhaps you compiled it as 'debug' and not 'release' so its trying to send to a debugger that doesn't exist.
Was This Post Helpful? 0
  • +
  • -

#3 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: run time error 53 - file not found

Posted 12 January 2013 - 02:06 PM

the file path is not full
you have to give the drive letter and all the folders where the file is located.

if the file is in the same folder as the program then use:

Oen App.Path & "File.txt" For Input as #1


note: this only work After the program is compiled.
if you use it from VB then BV go to its own folder to look for the file.

and dont forget to close the file with
Close #1

Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5675
  • View blog
  • Posts: 12,192
  • Joined: 02-June 10

Re: run time error 53 - file not found

Posted 12 January 2013 - 02:21 PM

Neku - your help contradicts itself. First you tell the OP that he has to include a volume letter and make a complete path. Then you say 'until it is VB' which is what this forum is: VB6


All .NET languages (C#, VB.NET, F# etc) will look in the same directory as the executable if you don't specify a complete path.

But this isn't VB.NET - It's {ancient} VB6 and I have no idea if VB6 is smart enough to do that.
Was This Post Helpful? 0
  • +
  • -

#5 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: run time error 53 - file not found

Posted 12 January 2013 - 02:31 PM

VB6 does look in its own folder unless:

1) complete file path is given: aka "C:\test folder\test file.txt"

2) [after compiled] App.Path & "File.txt" (if its inside a folder thats inside the main program folder you need to write that too)

problem with number 2 is: if you run the program via VB6, that is debugging the program then the keyword App.Path will force VB to look inside its own folder.
thats because App.Path link to the program EXE, this case VB itself.

App.Path is used so you dont have to write hardwritten file path.
if you have hardwritten file path then a program will misbehave when it dont find the file.
example:
program is installed on drive D.
it need to look for a file in a folder called Data, but while the folder is on drive D the program look for it in drive C because it has the line:

Open "C:\program\data\datafile.txt" For Input As #1


the program will crash (or give error if you handle the problem) when it wont find the file.

but if you write
Open App.Path & "\data\datafile.txt" For Input As #1
then the program will always look for the file on the same driver it was installed on.

This post has been edited by Neku: 12 January 2013 - 02:40 PM

Was This Post Helpful? 0
  • +
  • -

#6 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: run time error 53 - file not found

Posted 14 January 2013 - 06:00 PM

Neku is quite right. If you run the program in debug mode, app.path is the folder that contains vb.exe. In compiled mode, app.path is the folder that contains the compiled exe.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1