Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
connecting to oracle using vbscript
#1
Solved: 11 Years, 4 Months ago
I am getting the error when running the below code.
'The connection can't be used to perform this operation. It is either closed or invalid in this context'.

Please help with the below code.

Code:
'Connecting to Oracle
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set Conn_Obj = CreateObject("ADODB.Connection")
Set Rec_Obj = CreateObject("ADODB.Recordset")
Conn_Obj.Open "DRIVER= Oracle in OraClient10g_home1;SERVER = oracle_server;Data Source = FITN;UID= user1;PWD= passwd"

Rec_Obj.CursorLocation = adUseClient

Rec_Obj.Open "select ir.cusip from  market.instrument ir where ir.cusip ='20172KC78' adOpenStatic,adLockOptimistic"

While not(Rec_Obj.EOF)

Msgbox "Result " & Rec_Obj.Fields.Item("cusip")&vbCrLf

      Rec_Obj.MoveNext
      
Wend
Rec_Obj.Close
Conn_Obj.Close
Set Rec_Obj = Nothing
Set Conn_Obj = Nothing
Msgbox "It is a success"
Reply


Messages In This Thread
connecting to oracle using vbscript - by snandini - 01-27-2009, 12:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Request Help | Usage of Oracle Add-In for Oracle SQL Developer Nasir Ahmed 3 3,562 06-18-2014, 04:28 PM
Last Post: vinod123
  Connecting MQ to QTP through VBScript Priya.Shah134 0 4,339 05-22-2010, 03:33 PM
Last Post: Priya.Shah134
  Connecting to Oracle DB via JDBC using QTP vishnuvpotty 3 14,986 02-25-2010, 10:45 AM
Last Post: Saket
  Connecting Linux machine from QTP gauri 0 2,907 02-18-2010, 03:51 PM
Last Post: gauri
  Why Constant Variables while connecting to DB mona 4 5,167 07-27-2009, 02:16 PM
Last Post: mona

Forum Jump:


Users browsing this thread: 1 Guest(s)