OLE with Oracle Objects
Keywords: OLE Oracle Objects
Question:
Does anyone have an example of using the ObjectOpen with Oracle objects? Any ObjectOpen example
would be appreciated.
Answer:
Try opening regedit and searching for ORACLE.
Then try to find a registry subkey called
ProgID nearby. Use the filed in the ProgId (default) dataitem in the ObjectOpen.
Question (cont'd):
This "kinda" works because I don't get an error until I try to display the dynaset...
OraSession = Objectopen("OracleInProcServer.XOraSession")
;'Create the OraDatabase Object by opening a
;'connection to Oracle.
OraDatabase = OraSession.OpenDatabase("database", "userid/password", 0)
;'Create the orads Object.
orads = OraDatabase.DbCreateDynaset("select * from notifications", 0)
addfield = orads.fields("address")
;message("orads", orads.recordcount)
; this is where the errors start. I double checked the oracle constants to make sure
;the EOF value is correct.
;I also tried it without the if stmt, but it errors on the message stmt.
if orads.eof == 0
message("Dynaset", addfield.value)
orads.movenext
endif
objectclose(orads)
objectclose(OraDatabase)
objectclose(OraSession)
message ("Oracle OLE via Winbatch", "End of Job")
Answer:
Try ...
if orads.eof() == 0
message("Dynaset", addfield.value())
orads.movenext
endif
Article ID: W13669
Filename: OLE and Oracle Objects.txt