I have a file mark.mdb in a known location. i want to rename this file to test.mdb in the same location.
Any ideas?
I am using VB5 SP3
Printable View
I have a file mark.mdb in a known location. i want to rename this file to test.mdb in the same location.
Any ideas?
I am using VB5 SP3
You could use the FileSystemObject and make this really easy.
Hope this helps.Code:
Dim fso
Dim AppPath as string
Set fso=CreateObject("scripting.filesystemObject")
AppPath="c:\windows\desktop\database\db11\"
fso.CopyFile AppPath & "sourcebook.mdb",AppPath & "testbook.mdb"
Here is another method. It copies the file with a new name, then delete's the old one.
Code:SourceFile = "C:\Windows\Desktop\tttt.txt"
DestFile = "C:\Windows\Desktop\MyNewFileName.txt"
FileCopy SourceFile, DestFile
Kill SourceFile
Thanks,
All is well in the land of file renaming