Ide Indy Delphi

Title: oo4o and Delphi
Question: How use OO4O in Delphi
Answer:
Oracle provide us with OO4O for working with DB.
I weel show how we can use it for Delphi.
******
uses COmObj;
procedure TestOO4O;
var
OraSession,OraDatabase, OraDynaSet : Variant;
i : integer;
begin
OraSession := CreateOleObject('OracleInProcServer.XOraSession');
// Connect to Oracle
OraDatabase := OraSession.OpenDatabase['DB','user/passwd',0];
//Get DataBase Information
memo1.lines.add('RDBMSVersion: '+OraDatabase.RDBMSVersion);
// Open Cursor
OraDynaSet := OraDatabase.CreateDynaSet['select * from user_tables', 0];
// Get Fields Count
memo1.Lines.Add(OraDynaSet.FieldS.count);
// Show Fields Names and Size
for i := 1 to OraDynaSet.FieldS.count-1 do
begin
memo1.Lines.Add(OraDynaSet.FieldName[i]+':'+IntToStr(OraDynaSet.Fields [i].size));
end;
// Navigate Query
memo1.Lines.Add(OraDynaSet.FieldS.iTEM[0].value); // pos 0
Oradynaset.MoveNext; // forward
memo1.Lines.Add(OraDynaSet.FieldS.iTEM[0].value); // pos 1
Oradynaset.MovePrevious; // Backward
memo1.Lines.Add(OraDynaSet.FieldS.iTEM[0].value); // pos 0 now
// Process Cursor
While not OraDynaset.EOF do
begin
memo1.Lines.Add(OraDynaSet.FieldS.iTEM[0].value);
Oradynaset.MoveNext;
end;
end;