|
| |
|
|
accessman
Posts: 74 Joined: 9/13/2005 Status: offline
|
Filecopy - 4/28/2006 13:18:06
Hi, I have a question. Function makecopy() FileCopy Currentdb.Name, "C:\backuptemp.mdb" End Function It doesn't work, the error message give out Permission Denied How can I make the copy itself? Thanks.
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Filecopy - 4/28/2006 13:56:37
quote:
Permission Denied You need to have write permissions to the directory where the file is to be written. And when running web page scripts, that usually means having the IUSER_machinename account with write privs. Here is an example script I use to copy a file using FSO's:
set fs=createobject("scripting.filesystemobject")
myOldDBFile = "C:\Inetpub\vhosts\mydomain.com\httpdocs\fpdb\myOldDB.mdb"
myNewDBFile = "C:\Inetpub\vhosts\vareview.com\httpdocs\fpdb\myNewDB.mdb"
fs.copyfile myNewDBFile, myOldDBFile
That help any?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
accessman
Posts: 74 Joined: 9/13/2005 Status: offline
|
RE: Filecopy - 4/28/2006 15:40:10
Hello, thank you very much. It works. I have another question. Can we use fileystem object to do compact db when it make copy? Follow your example: set fs=createobject("scripting.filesystemobject") myOldDBFile = currentdb.Name myNewDBFile = "C:\compbackupDB.mdb" fs.dbengine.compactdatabase myOldDBFile, myNewDBFile fs.copyfile myNewDBFile, myOldDBFile -------------------------------- I think that we make the copy file, first. then compact the copy file, right. Is it correct steps? Please let me know, thanks. Thanks.
< Message edited by accessman -- 4/28/2006 15:47:57 >
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Filecopy - 4/28/2006 20:52:08
quote:
Can we use fileystem object to do compact db Not that I'm aware of. There may be some script packages available on HotScripts.com
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|