Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Security Issue, not sure...

Author  Topic 

murrayb3024
Yak Posting Veteran

79 Posts

Posted - 2005-04-07 : 10:49:00
I built a DTS package, and one of the first things that it does is to create a backup of the database, then moves that backup to a folder on another server. When I run the dts package on the server with SQL Server on it it works just fine. But I then needed to create a VB app that can call this DTS package from a client computer. I have all the connection info figured out and can call the DTS package. The backup is created ok, but the package fails when I try to move the backup. Here is the code I am using (its and activeX script) for the move:

Msgbox "Start Move"
Dim oFSO
Dim sSourceFile
Dim sDestinationFile

Set oFSO = CreateObject("Scripting.FileSystemObject")

sSourceFile = "C:\SQLServer\Backups\JCTest.bak"
Msgbox "Opened Source"
sDestinationFile = "\\groups\JCArchives\Backups\JCTest.bak"
Msgbox "Opened Destination"

If oFSO.FileExists(sDestinationFile) Then oFSO.DeleteFile(sDestinationFile)
Msgbox "File Deleted"

oFSO.MoveFile sSourceFile, sDestinationFile
Msgbox "File Moved"

' Clean Up
Set oFSO = Nothing

I put message boxes in there so it lets me know where it is at in the script. I can get the message about "File Deleted" and I can go out to the server and see that the backup is no longer there. But the next message I get is a "Failed on Move" message which comes from an ActiveX Script I created for the On Fail of the first one. So I assume it is failing on

oFSO.MoveFile sSourceFile, sDestinationFile

I was thinking it is a security issue, but how can I run the delete script to get into the same destination folder and delete the backup? If it is security where do i need to look to fix this? Am I missing something simple?

murrayb3024
Yak Posting Veteran

79 Posts

Posted - 2005-04-08 : 09:31:52
any ideas, or is this just a stupid question?
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2005-04-08 : 09:51:57
Is it evaluating the source as LOCAL to the client and not local to the SERVER???
Go to Top of Page

murrayb3024
Yak Posting Veteran

79 Posts

Posted - 2005-04-08 : 09:57:04
Well the VB runs on a client, where the DTS Package is run on the sql server which also would be the location of the source. I guess I am confused as to the DTS package thinking the C is from the Client, is that possible?
Go to Top of Page

murrayb3024
Yak Posting Veteran

79 Posts

Posted - 2005-04-08 : 10:04:02
You were right, I put that bak file in the same file location on the client to test it and it worked fine. Major oversight on my part, thank you for pointing that out to me.
Go to Top of Page
   

- Advertisement -