Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Delphi7
Delphi7
Posted: 2003/04/22 09:42
 
hi, had some problems with delphi7 an fixed them (hope it isnt to unreadable):

in ncocidef.inc i added this after the delphi6 block:[/]

{$ifdef VER150} // Delphi 7
{$define OCI_D3}
{$define OCI_D35}
{$define OCI_D4}
{$define OCI_D5}
{$define OCI_D6}
{$define OCI_D7}
{$define OCI_DELPHI}
{$endif}


[i]and in ncocidb.pas i modifed the following

in interface:


TOCIStringList = class(TStringList)
{$IFNDEF OCI_D7}
private
function GetUpdateCount: Integer;
public
property UpdateCount: Integer read GetUpdateCount;
{$ENDIF}
end;

in implementation:

// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// TOCIStringList
{$IFNDEF OCI_D7}
type
__TStrings = class(TPersistent)
private
FUpdateCount: Integer;
end;

function TOCIStringList.GetUpdateCount: Integer;
begin
Result := __TStrings(Self).FUpdateCount;
end;
{$ENDIF}

and this:

procedure TOCICustomDatabase.ReleaseCursors(AExclude: TOCIDataSet);
var
dsList: TList;
i, n: Integer;
begin
DbgOut(tfStmt, 'ReleaseCursors start, CRS = ' + IntToStr(DataSetCount));

{$IFDEF OCI_D7}
dsList := TList.Create;
for i := 0 to GetDataSetCount-1 do
dsList.Add(DataSets[i]);

{$IFDEF OCI_D5}
dsList := __TCustomConnection(Self).FDataSets;
{$ELSE}
dsList := FDataSets;
{$ENDIF}
{$ENDIF}
dsList.Sort(SortOnUsage);
n := MulDiv(MaxCursors, IDSPctUsable, 100);
i := dsList.Count - 1;
{$IFDEF OCI_D7}
dsList.Free;
{$ENDIF}

.
.
.


andre
RE: Delphi7
Posted: 2003/04/23 08:38
 
I installed NCOCI on Delphi 7 and modified just one module ncocidef.inc like posted <A href=http://www.da-soft.com/ubb/Forum1/HTML/000301.html>here</A>
Why did you change other modules?
RE: Delphi7
Posted: 2003/04/24 08:00
 
the updatecount of the TOCIStringList returns a wrong value (> 2000000), so the TOCICustomQuery.DoSQLChange never updates the fexpandedsql. i think the hack with __tstrings ist no more allowed in d7 (or not allways working).

with __TCustomConnection i had no problems, but i'm not sure if ReleaseCursors was even called, so i changed too.
RE: Delphi7
Posted: 2003/04/24 08:04
 
btw, i made a mistake, must be like this:

procedure TOCICustomDatabase.ReleaseCursors(AExclude: TOCIDataSet);
var
dsList: TList;
i, n: Integer;
begin
DbgOut(tfStmt, 'ReleaseCursors start, CRS = ' + IntToStr(DataSetCount));

{$IFDEF OCI_D7}
dsList := TList.Create;
for i := 0 to GetDataSetCount-1 do
dsList.Add(DataSets[i]);
{$ELSE}

{$IFDEF OCI_D5}
dsList := __TCustomConnection(Self).FDataSets;
{$ELSE}
dsList := FDataSets;
{$ENDIF}
{$ENDIF}
dsList.Sort(SortOnUsage);
n := MulDiv(MaxCursors, IDSPctUsable, 100);
i := dsList.Count - 1;
[b]{$IFDEF OCI_D7}
dsList.Free;
{$ENDIF}[/]
.
.
.