Showing posts with label connect. Show all posts
Showing posts with label connect. Show all posts

Friday, March 30, 2012

If file exist, FTP file

Within a SQL Server Job, I am using the following vbscript to connect to a
FTP server and FTP a file:
strLocalFolderName = "My Folder Name where we put the file to be FTPed"
strFTPServerName = "FTP Server Name"
strLoginID = "FTP Server Login ID"
strPassword = "FTP Login ID Password"
strFTPServerFolder = "Folder Name on FTP server where the file resides"
strFile2Get = "This file"
strFTPScriptFileName = strLocalFolderName & "\FTPScript.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists(strFTPScriptFileName)) Then
objFSO.DeleteFile (strFTPScriptFileName)
End If
Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("ascii")
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("get " & strFile2Get)
objMyFile.WriteLine ("bye")
objMyFile.Close
Set objFSO = Nothing
Set objMyFile = Nothing
Before I FTP the file, I need to check to see if that file exist. What is
the best way for me to check to see if that file exist? Or how can I
capture the code from the FTP command if it can't find the file?Oops, I left this out of my code example. Add this to the end of the code:
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run ("ftp -s:" & chr(34) & strFTPScriptFileName & chr(34))
Set objShell = Nothing
"David" wrote:

> Within a SQL Server Job, I am using the following vbscript to connect to a
> FTP server and FTP a file:
> strLocalFolderName = "My Folder Name where we put the file to be FTPed"
> strFTPServerName = "FTP Server Name"
> strLoginID = "FTP Server Login ID"
> strPassword = "FTP Login ID Password"
> strFTPServerFolder = "Folder Name on FTP server where the file resides"
> strFile2Get = "This file"
> strFTPScriptFileName = strLocalFolderName & "\FTPScript.txt"
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> If (objFSO.FileExists(strFTPScriptFileName)) Then
> objFSO.DeleteFile (strFTPScriptFileName)
> End If
> Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
> objMyFile.WriteLine ("open " & strFTPServerName)
> objMyFile.WriteLine (strLoginID)
> objMyFile.WriteLine (strPassword)
> objMyFile.WriteLine ("cd " & strFTPServerFolder)
> objMyFile.WriteLine ("ascii")
> objMyFile.WriteLine ("lcd " & strLocalFolderName)
> objMyFile.WriteLine ("get " & strFile2Get)
> objMyFile.WriteLine ("bye")
> objMyFile.Close
> Set objFSO = Nothing
> Set objMyFile = Nothing
> Before I FTP the file, I need to check to see if that file exist. What
is
> the best way for me to check to see if that file exist? Or how can I
> capture the code from the FTP command if it can't find the file?

Friday, March 23, 2012

IE cannot access Webpage for Report Manager-what can I do?

Greetings,
I am trying to access the Report Manager website, but I am getting an error
message (http 403) that IE can connect to the website but doesn't have the
permision - requires login. Here is what I did - I am at the server computer
logged in as administrator (the builtin administrator - sa). I go to
Start/all programs/Microsoft Sql Server/Reporting Services/Report Manager.
This brings up IE to the webpage where I get the message that I am not
authorized to access the site (error http 403) and that I need to log in.
But there is no login box anywhere. What do I need to do to access the
Report Manager site? Do I need to configure something in my Server
Administration? Or do I need to configure something in IIS?
Thanks,
RichI went to IIS to the Reports Virtual directory to Pages and found
Folder.aspx. The security set on the Reports dir is Window Integrated
security and the same for the Pages directory. It says that the user will
need to enter an ID/password. But when I try to bring up
http://myserver/reports/pages/folder.aspx all I get is the error message
"...Forbidden..." and I do not get the logon dialog.
Do I need to modify something in IIS?
"Rich" wrote:
> Greetings,
> I am trying to access the Report Manager website, but I am getting an error
> message (http 403) that IE can connect to the website but doesn't have the
> permision - requires login. Here is what I did - I am at the server computer
> logged in as administrator (the builtin administrator - sa). I go to
> Start/all programs/Microsoft Sql Server/Reporting Services/Report Manager.
> This brings up IE to the webpage where I get the message that I am not
> authorized to access the site (error http 403) and that I need to log in.
> But there is no login box anywhere. What do I need to do to access the
> Report Manager site? Do I need to configure something in my Server
> Administration? Or do I need to configure something in IIS?
> Thanks,
> Rich