FileCopy problem on 2K and XP 
Author Message
 FileCopy problem on 2K and XP

I have a VB4 app that contains the line:

FileCopy var1 var2

Var1 and Var2 are string variables

The len(var1) is around 70 and len(var2) about 76. Both contain full paths.
i.e "C:\Program Files etc"

This code runs fine on 95, 98, and ME (I think) but fails on 2K and XP with
Error 75 File/Path error.

Can anybody explain why it fails on the new OS but is OK on the older ones?
And offer a solution?

Thanks in advance for any replies



Sat, 31 Jul 2004 21:11:48 GMT  
 FileCopy problem on 2K and XP


Quote:
> I have a VB4 app that contains the line:

> FileCopy var1 var2

> Var1 and Var2 are string variables

> The len(var1) is around 70 and len(var2) about 76. Both
contain full paths.
> i.e "C:\Program Files etc"

> This code runs fine on 95, 98, and ME (I think) but fails on
2K and XP with
> Error 75 File/Path error.

> Can anybody explain why it fails on the new OS but is OK on
the older ones?
> And offer a solution?

They're obviously seperate machines.  Possibly:

1)  Var1 does not exist.
2)  Var2 exists and is read-only.
3)  Either Var1 or Var2 is already open.



Sun, 01 Aug 2004 00:26:47 GMT  
 FileCopy problem on 2K and XP


Quote:



> > I have a VB4 app that contains the line:

> > FileCopy var1 var2

> > Var1 and Var2 are string variables

> > The len(var1) is around 70 and len(var2) about 76. Both
> contain full paths.
> > i.e "C:\Program Files etc"

> > This code runs fine on 95, 98, and ME (I think) but fails on
> 2K and XP with
> > Error 75 File/Path error.

> > Can anybody explain why it fails on the new OS but is OK on
> the older ones?
> > And offer a solution?

> They're obviously seperate machines.  Possibly:

> 1)  Var1 does not exist.

It does. Tested before the FileCopy

Quote:
> 2)  Var2 exists and is read-only.

It does. Tested before the FileCopy

Quote:
> 3)  Either Var1 or Var2 is already open.

Not true either I'm afraid. Any other ideas?


Sun, 01 Aug 2004 00:41:31 GMT  
 FileCopy problem on 2K and XP


Fri, 19 Jun 1992 00:00:00 GMT  
 FileCopy problem on 2K and XP

Quote:





> > > I have a VB4 app that contains the line:

> > > FileCopy var1 var2

> > > Var1 and Var2 are string variables

> > > The len(var1) is around 70 and len(var2) about 76. Both
> > contain full paths.
> > > i.e "C:\Program Files etc"

> > > This code runs fine on 95, 98, and ME (I think) but fails on
> > 2K and XP with
> > > Error 75 File/Path error.

> > > Can anybody explain why it fails on the new OS but is OK on
> > the older ones?
> > > And offer a solution?

> > They're obviously seperate machines.  Possibly:

> > 1)  Var1 does not exist.

> It does. Tested before the FileCopy

> > 2)  Var2 exists and is read-only.

> It does. Tested before the FileCopy

Sorry It does NOT. Tested before the FileCopy! [Over zealous copy and paste
the first time!]

- Show quoted text -

Quote:

> > 3)  Either Var1 or Var2 is already open.

> Not true either I'm afraid. Any other ideas?



Sun, 01 Aug 2004 00:59:05 GMT  
 FileCopy problem on 2K and XP
Hello

I read about this problem in other newsgroups. I think the problem is that
newer OS use
newer elements of the filesystem (folders instead of directories). VB4 is a
quite bit older
and maybee can't handle that.

Try the following:
- Check with the Dir function, if VB can see the specified directories.
Insert some message boxes to
show the results, so you can see if the directories are found at runtime.
- If possible, use the Microsoft Scripting Runtime-Component (scrrun.dll,
part of the Windows Scripting Host).
It's a type library and can be included in VB projects as a reference. It
contains the FileSystemObject,
which can do things like Copy, Move, Delete... Files and Folders. There are
usefull functions like
GetAbsolutePathName and BuildPath. The scrrun.dll should be on 2K, XP and NT
workstations by default.
I tested the following code with VB4 on a NT4 machine:

    Dim oFSO As Scripting.FileSystemObject
    Set oFSO = New FileSystemObject
    oFSO.CopyFile "C:\MyFile.txt", "D:\MyFile.txt", True
    Set oFSO = Nothing

It works without problems.

Philipp

rcthelp schrieb in Nachricht ...

Quote:






>> > > I have a VB4 app that contains the line:

>> > > FileCopy var1 var2

>> > > Var1 and Var2 are string variables

>> > > The len(var1) is around 70 and len(var2) about 76. Both
>> > contain full paths.
>> > > i.e "C:\Program Files etc"

>> > > This code runs fine on 95, 98, and ME (I think) but fails on
>> > 2K and XP with
>> > > Error 75 File/Path error.

>> > > Can anybody explain why it fails on the new OS but is OK on
>> > the older ones?
>> > > And offer a solution?

>> > They're obviously seperate machines.  Possibly:

>> > 1)  Var1 does not exist.

>> It does. Tested before the FileCopy

>> > 2)  Var2 exists and is read-only.

>> It does. Tested before the FileCopy
>Sorry It does NOT. Tested before the FileCopy! [Over zealous copy and paste
>the first time!]

>> > 3)  Either Var1 or Var2 is already open.

>> Not true either I'm afraid. Any other ideas?



Mon, 02 Aug 2004 07:20:37 GMT  
 FileCopy problem on 2K and XP


Quote:
> Hello

> I read about this problem in other newsgroups. I think the problem is that
> newer OS use
> newer elements of the filesystem (folders instead of directories). VB4 is
a
> quite bit older
> and maybee can't handle that.

> Try the following:
> - Check with the Dir function, if VB can see the specified directories.
> Insert some message boxes to
> show the results, so you can see if the directories are found at runtime.
> - If possible, use the Microsoft Scripting Runtime-Component (scrrun.dll,
> part of the Windows Scripting Host).
> It's a type library and can be included in VB projects as a reference. It
> contains the FileSystemObject,
> which can do things like Copy, Move, Delete... Files and Folders. There
are
> usefull functions like
> GetAbsolutePathName and BuildPath. The scrrun.dll should be on 2K, XP and
NT
> workstations by default.
> I tested the following code with VB4 on a NT4 machine:

>     Dim oFSO As Scripting.FileSystemObject
>     Set oFSO = New FileSystemObject
>     oFSO.CopyFile "C:\MyFile.txt", "D:\MyFile.txt", True
>     Set oFSO = Nothing

> It works without problems.

> Philipp

<snip>
Thanks for this. I'm not sure I'm literate enough in the more up to date
Windows technologies to understand what you mean.

In terms of your suggestion, the logic of my program is as follows:

1. Get a path from a registry entry into Path1. If the registry entry
doesn't exist, quit
2. Check that Path1 & "\Data\CSS0.DAT" exists. If it doesn't, quit
3. Check that App.Path & "\Backups" exists. If it does not, create it. Trap
any errors from MkDir and quit if there are any.
4. In a loop, get the first value of X where App.Path & "\Backups\" &
"Backup " & Counter & "of CSS0.DAT" does NOT exist
5. FileCopy Path1 & "\Data\CSS0.DAT" , App.Path & "\Backups\" & "Backup " &
Counter & "of CSS0.DAT"

In steps 1 and 4 I have used both FileDateTime and GetAttr and trapped
errors so I know that they are all successful.

But it is step 5 that works OK in Win 95, 98 and ME and fails with error 75
in 2K and XP

So as far as I'm concerned, in 2K and XP all the previous calls have behaved
the same in 95 through XP, but for some inexplicable reason, the FileCopy
does not.



Mon, 02 Aug 2004 09:04:35 GMT  
 FileCopy problem on 2K and XP
One entry on Error 75 states:

"You attempted to change a Visual Basic project within a
database or document.
You can't make design changes to the project."

Maybe since you're copying into a VB subfolder, it thinks you
are modifying the project.
My default App.Path returns the project folder.

Try copying to another folder and see if it works.

--
________________________________________________________________

Falls Church, {*filter*}ia                        703-560-7380
________________________________________________________________

Quote:

in message

> > Hello

> > I read about this problem in other newsgroups. I think the
problem is that
> > newer OS use
> > newer elements of the filesystem (folders instead of

directories). VB4 is
Quote:
> a
> > quite bit older
> > and maybee can't handle that.

> > Try the following:
> > - Check with the Dir function, if VB can see the specified
directories.
> > Insert some message boxes to
> > show the results, so you can see if the directories are
found at runtime.
> > - If possible, use the Microsoft Scripting Runtime-Component
(scrrun.dll,
> > part of the Windows Scripting Host).
> > It's a type library and can be included in VB projects as a
reference. It
> > contains the FileSystemObject,
> > which can do things like Copy, Move, Delete... Files and
Folders. There
> are
> > usefull functions like
> > GetAbsolutePathName and BuildPath. The scrrun.dll should be
on 2K, XP and
> NT
> > workstations by default.
> > I tested the following code with VB4 on a NT4 machine:

> >     Dim oFSO As Scripting.FileSystemObject
> >     Set oFSO = New FileSystemObject
> >     oFSO.CopyFile "C:\MyFile.txt", "D:\MyFile.txt", True
> >     Set oFSO = Nothing

> > It works without problems.

> > Philipp
> <snip>
> Thanks for this. I'm not sure I'm literate enough in the more
up to date
> Windows technologies to understand what you mean.

> In terms of your suggestion, the logic of my program is as
follows:

> 1. Get a path from a registry entry into Path1. If the
registry entry
> doesn't exist, quit
> 2. Check that Path1 & "\Data\CSS0.DAT" exists. If it doesn't,
quit
> 3. Check that App.Path & "\Backups" exists. If it does not,
create it. Trap
> any errors from MkDir and quit if there are any.
> 4. In a loop, get the first value of X where App.Path &
"\Backups\" &
> "Backup " & Counter & "of CSS0.DAT" does NOT exist
> 5. FileCopy Path1 & "\Data\CSS0.DAT" , App.Path & "\Backups\"
& "Backup " &
> Counter & "of CSS0.DAT"

> In steps 1 and 4 I have used both FileDateTime and GetAttr and
trapped
> errors so I know that they are all successful.

> But it is step 5 that works OK in Win 95, 98 and ME and fails
with error 75
> in 2K and XP

> So as far as I'm concerned, in 2K and XP all the previous
calls have behaved
> the same in 95 through XP, but for some inexplicable reason,
the FileCopy
> does not.



Mon, 23 Aug 2004 01:02:29 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Newbie: Problem with FileCopy on 2K and XP

2. Change password problem on NT (works on 2k/xp)

3. FileCopy and XP

4. Error in Access (2K/XP)

5. SaveAs in office 2K & Office XP

6. Incompatibility between Office XP and 2K

7. Word: Macros is XP much slower than 2k

8. Access 2k and Access XP conflicts???

9. XP and 2K Question

10. Is this possible in Outlook 2k/XP?

11. Retrieving Contact Info Outlook 2K, XP

12. Outlook 2k or XP signatures

 

 
Powered by phpBB® Forum Software