Try this out:
Copy paste the whole thing.. Just u have to enter db value(delete yourDBname and pass the actual dbname)
Hope this works...
Regards,
Ritesh
Code:
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set ObjCon=createobject("adodb.connection")
Set ObjRec=createobject("adodb.recordset")
ObjCon.open "Data Source=FITN;server=oracle_server;uid=user1;pwd=passwd;db=yourDBName"
ObjRec.CursorLocation = adUseClient
ObjRec.CursorType = adOpenStatic
ObjRec.LockType = adLockOptimistic
ObjRec.Source="select ir.cusip from market.instrument ir where ir.cusip ='20172KC78' adOpenStatic,adLockOptimistic"
While not(ObjRec.EOF)
ObjRec.ActiveConnection=ObjCon
ObjRec.Open
Msgbox "Result " & ObjRec.Fields.Item("cusip")&vbCrLf
ObjRec.MoveNext
ObjRec.Close
Copy paste the whole thing.. Just u have to enter db value(delete yourDBname and pass the actual dbname)
Hope this works...
Regards,
Ritesh