LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Passing SQLPlus script location using Windows Script Host Object Model

On Feb 2, 6:36*am, Scott Spence wrote:
Ok, this is now resolved [in a fashion]

What I'm doing is passing the file location parameter to a .bat file

So I have my .bat file OracleSQL.bat which contains this code:

@echo off
sqlplus @%1
exit;

I can now shell out to the batch file with the file parameter:

Dim strBatchName As String

strBatchName = "C:\location\of\bat\OracleSQL.bat Z:/aFolder/aScript.sql"
Shell strBatchName

Done :)


Glad that you found a work-around. I suspect that the problem lies in
the area of permissions. The fact that you can type a string at the
command prompt and have it work but not have identitical behavior when
you use the same string with the script host run method suggests that
something is preventing the script-host from accessing certain files.
Either that or the directory that the script-host is trying to run the
command in is a different directory from that where the .bat file runs
-- though you seem to be passing fully-qualified paths so I don't see
why that should be an issue.

As an aside - have you checked out Power Shell yet? I have been
dabbling in it recently and it really does seem to be more powerful
than VBScript - although I haven't yet figured out how to call it
seemlessly from VBA. A less kludgy solution to your problem would
probably be possible with Power Shell.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Script Host in Excel VBA jasontferrell Excel Programming 10 November 4th 09 09:27 PM
PASSING PARAMETER FORM DOS script to Excel BruceWyne Excel Programming 4 November 3rd 06 03:02 AM
Passing Data to a Line in a VBA Script Danny Young Excel Programming 1 October 12th 06 06:14 AM
Pass a variable back to the host script? mb Excel Programming 2 October 29th 05 07:02 PM
Use Windows Script to run Windows Explorer Search? Ian Elliott[_3_] Excel Programming 0 January 12th 04 05:03 PM


All times are GMT +1. The time now is 09:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"