View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default Passing SQLPlus script location using Windows Script Host Object Model

On Jan 31, 11:26*am, Scott Spence wrote:
It doesn't even open the script in SQLPlus

Like I said in the main post I get an error: "SP2-0310: unable to open file location "Z:/aFolder/aScript.sql;"

I have validated the location and file exist, it just looks like the parameter isn't passed in correctly for some reason

If I just paste in the file location: @Z:/aFolder/aScript.sql;

It runs fine but when I try pass it I get the error message without the @ in the command string "SP2-0310: unable to open file location "Z:/aFolder/aScript.sql;"


Try

Dim WShell As New WshShell
WShell.Run "sqlplus " & " "
& strFilePath
End Sub

The only addition from your first script is to put a space between the
sql server path and the script that you are trying to execute

-John