Subject | D5 to D7 migration |
---|---|
Author | Hardy , |
Post date | 2010-08-02T10:02:44Z |
We are trying to migrate our program from D5.1 to D7.1,
Our codes below well on D5 but it does like in D7, please help....
// *** it is stuck on this statement with message SQL Parse Error: Parameter
name expected on D7
Delta := (IDispatch(AProvider[0]) as
IAppServer).AS_ApplyUpdates(AProvider[1], Delta, 0, ErrCount, OwnerData)
{Server call for Interbase}
procedure CDSIBApplyUpdates(ADatabase : TIBODatabase; var vDeltaArray:
OleVariant; const vProviderArray: OleVariant; Local: Boolean);
var
i : integer;
LowArr, HighArr: integer;
P: PArrayData;
begin
{Wrap the updates in a transaction. If any step results in an error, raise}
{an exception, which will Rollback the transaction.}
ADatabase.Connected:=true;
if not ADatabase.DefaultTransaction.Intransaction then
ADatabase.DefaultTransaction.StartTransaction;
try
LowArr:=VarArrayLowBound(vDeltaArray,1);
HighArr:=VarArrayHighBound(vDeltaArray,1);
P:=VarArrayLock(vDeltaArray);
try
for i:=LowArr to HighArr do
ApplyDelta(vProviderArray[i], P^[i], Local);
finally
VarArrayUnlock(vDeltaArray);
end;
ADatabase.DefaultTransaction.Commit;
except
ADatabase.DefaultTransaction.Rollback;
end;
end;
procedure ApplyDelta(AProvider: OleVariant; var Delta : OleVariant; Local:
Boolean);
var
ErrCount : integer;
OwnerData: OleVariant;
begin
if not VarIsNull(Delta) then
begin
// ScktSrvr does not support early-binding - TLocalAppServer does not
support IAppServerDisp typecast
if Local then
// *** it is stuck on this statement with message SQL Parse Error:
Parameter name expected
Delta := (IDispatch(AProvider[0]) as
IAppServer).AS_ApplyUpdates(AProvider[1], Delta, 0, ErrCount, OwnerData)
else
Delta :=
IAppServerDisp(IDispatch(AProvider[0])).AS_ApplyUpdates(AProvider[1], Delta, 0,
ErrCount, OwnerData);
if ErrCount > 0 then
SysUtils.Abort; // This will cause Rollback in the calling procedure
end;
end;
[Non-text portions of this message have been removed]
Our codes below well on D5 but it does like in D7, please help....
// *** it is stuck on this statement with message SQL Parse Error: Parameter
name expected on D7
Delta := (IDispatch(AProvider[0]) as
IAppServer).AS_ApplyUpdates(AProvider[1], Delta, 0, ErrCount, OwnerData)
{Server call for Interbase}
procedure CDSIBApplyUpdates(ADatabase : TIBODatabase; var vDeltaArray:
OleVariant; const vProviderArray: OleVariant; Local: Boolean);
var
i : integer;
LowArr, HighArr: integer;
P: PArrayData;
begin
{Wrap the updates in a transaction. If any step results in an error, raise}
{an exception, which will Rollback the transaction.}
ADatabase.Connected:=true;
if not ADatabase.DefaultTransaction.Intransaction then
ADatabase.DefaultTransaction.StartTransaction;
try
LowArr:=VarArrayLowBound(vDeltaArray,1);
HighArr:=VarArrayHighBound(vDeltaArray,1);
P:=VarArrayLock(vDeltaArray);
try
for i:=LowArr to HighArr do
ApplyDelta(vProviderArray[i], P^[i], Local);
finally
VarArrayUnlock(vDeltaArray);
end;
ADatabase.DefaultTransaction.Commit;
except
ADatabase.DefaultTransaction.Rollback;
end;
end;
procedure ApplyDelta(AProvider: OleVariant; var Delta : OleVariant; Local:
Boolean);
var
ErrCount : integer;
OwnerData: OleVariant;
begin
if not VarIsNull(Delta) then
begin
// ScktSrvr does not support early-binding - TLocalAppServer does not
support IAppServerDisp typecast
if Local then
// *** it is stuck on this statement with message SQL Parse Error:
Parameter name expected
Delta := (IDispatch(AProvider[0]) as
IAppServer).AS_ApplyUpdates(AProvider[1], Delta, 0, ErrCount, OwnerData)
else
Delta :=
IAppServerDisp(IDispatch(AProvider[0])).AS_ApplyUpdates(AProvider[1], Delta, 0,
ErrCount, OwnerData);
if ErrCount > 0 then
SysUtils.Abort; // This will cause Rollback in the calling procedure
end;
end;
[Non-text portions of this message have been removed]