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 Administration (2000)
 ActiveX Script in a Job Step...

Author  Topic 

RobMarsh
Starting Member

28 Posts

Posted - 2002-07-15 : 15:21:41
Hi guys,
Yet another problem that is doing my head in...

I've currently got log shipping set up between 2 SQL 7.0 Servers. This is the do it yourself method using linked servers, not the all singing and dancing official Microsoft technique (I prefer the simple way anyhow..)

I'm modifying the way the shipping is done, and art of this requires an ActiveX script in a Job step to open a file and read a line in from it.

Simple, I hear you cry. Thats what I thought...

I'm using the File Scripting Object to open the file as follows:

Set objTextFile = objFSO.GetFile("\\BHONTPYSQ1\e$\MSSQL7\BACKUP\PAYPLUS\TRANS\TransLogName.txt")

Set objTS = objTextFile.OpenAsTextStream (ForReading,true)

Will it open it? Not a chance, I keep getting 'File Not Found'. Dispite the fact that if I cut and paste the path to a DOS Shell I can do a directory of it quite happily. And its not permissions, as I've set access to full for everybody just to make sure that thats not whats causing it (I'll set it to something sensible when its working).

If I set the path to a local directory on the server, it picks that up fine - which is all the more frustrating.

Are there some limitations to the FSO that I should be aware of?

Thanks,

Rob

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-15 : 15:28:21
I could be that the credentials of your SQL Agent process do not have access to the e$ share. Try creating a test job such that on the Advanced tab of the step it ouputs to \\BHONTPYSQ1\e$\MSSQL7\BACKUP\PAYPLUS\TRANS\test.txt . . . have the job step simply select 'hello' . . . this should tell you if the agent can use the share....

<O>
Go to Top of Page

RobMarsh
Starting Member

28 Posts

Posted - 2002-07-15 : 15:45:33
The SQLAgent User has full access to that share.

I should add that the really weird thing is that, despite the error message coming up (which stops the job after the step has finished). The actual step itself seems to complete.

Despite the error message claiming that the file is not found, the file does get opened and the record is read. The state the files in the directory finish in can only be reached if the record was read in and used.







Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-15 : 15:58:03
Could the 'File Not Found' error be related to some other processing in the job and not this FSO?

<O>
Go to Top of Page

RobMarsh
Starting Member

28 Posts

Posted - 2002-07-16 : 08:38:11
I'm afraid not, the error gives a line number in the script and the line number is the one that tries to open the file...

Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-07-16 : 09:04:28
I had a very similar problem recently. It was resolved by simply re-entering the sql agent service credentials and bouncing the agent...unexplained.

<O>
Go to Top of Page
   

- Advertisement -