Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - problem with running script remotely - ODBC connection - ORACLE DB

Reply
 
Old 03-20-2009   #1 (permalink)
esska


 
 

problem with running script remotely - ODBC connection - ORACLE DB

Hi,
I wrote script which connect to oracle 10. It works locally, but when
I try to run this remotely I get error that connection can't be done.
I try to use driver for Oraclecilen

I have client at different machine. When I try to add driver paramter
in ODBC connection I receieve error:
Provider for ODBC Drivers: [Microsoft][ODBC Driver Manager] Data
source name no
t found and no default driver specified

the erros is in this line: connection.Open connectionString

I tried everything to run this by SCOM.

The script is below:
' Parameters that should be passed to this script
' 1 st - User name for database
' 2 nd - Password
' 3 rd - FileFlag
' 4 th - sth
' 5 th - sth
Set collArg = WScript.Arguments

If collArg.Count < 5 Then 'brak argumentow

Set WshShell = WScript.CreateObject("WScript.Shell")
strCommand = "eventcreate /T Informtion /SO XXXX /ID 123 /L
Application /D " & _
Chr(34) & "Script '" & Wscript.ScriptName & "' has wrong number
of parameters."& Chr(34)
WshShell.Run strCommand

Else ' ok

Dim User, Password, BackupFlag, a, b
User = collArg(0)
Password = collArg(1)
BackupFlag = collArg(2)
a= CInt(collArg(3))
b= CInt(collArg(4))

Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists(file) Then
else
'Dim connectionString: connectionString =
"dsn=ORACLE;uid=XXXX;pwd=XXXX"
Dim connectionString: connectionString =
"server=FQDN;dsn=ORACLE;uid=XXX;pwd=XXXX"

Dim connection: Set connection = CreateObject("ADODB.Connection")
Dim rows: Set rows = CreateObject("ADODB.Recordset")

connection.Open connectionString


Set connectionString = Nothing
Set connection = Nothing
End If
End If


any idea?

My System SpecsSystem Spec
Old 03-20-2009   #2 (permalink)
esska


 
 

Re: problem with running script remotely - ODBC connection - ORACLEDB

the error is:
The connection cannot be used to perform this operation. It is either
closed or invalid in this context. ADODB.Recordset

any idea?
My System SpecsSystem Spec
Old 03-20-2009   #3 (permalink)
gimme_this_gimme_that


 
 

Re: problem with running script remotely - ODBC connection - ORACLEDB

You need to register your Oracle database with ODBC and test it there
to see if it connects.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How to login any Windows Machine remotely using script VB Script
Script to install application remotely on a windows machine VB Script
odbc connection Microsoft Office
Oracle ODBC driver and Vista Vista General
I have a problem creating a ODBC connection to a Foxpro Database!! Vista file management


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46