I have the following code running very fine on Windows XP and Access DB
But if I try the same program and datafile on Windows 7 Enterprise I get a message telling me that fldfee_max isn't found. Since it is the same db as on XP that can't be the case.
function TCustomSetup.GetFeeMax: Currency;
var
Query: TUniQuery;
begin
Result := 1;
Query := TUniQuery.Create(Nil);
Query.Connection := frmDB_Conn.conDBserver;
try
Query.SQL.Clear;
Query.SQL.Add('SELECT * FROM ' + conTable_Setup);
try
begin
Query.Connection := frmDB_Conn.conDBserver;
Query.Execute;
If Query.Recordcount > 0 Then
begin
Result := Query.FieldByName('fldfee_max').AsCurrency;
end
Else
begin
Result := 0;
end;
end;
except
on E: exception do
begin
Logfile.Error('GetFeeMax ' + E.Message);
end
end;
finally
Query.Free;
end;
end;
Windows 7 and Access
I changed my uses list
From
SysUtils,
Forms,
Windows,
UniDacVcl,
AccessUniProvider,
MySQLUniProvider,
SQLServerUniProvider,
SQLiteUniProvider,
UniProvider,
Uni,
To
SysUtils,
Forms,
Windows,
MemDS,
DBAccess,
UniDacVcl,
AccessUniProvider,
MySQLUniProvider,
SQLServerUniProvider,
SQLiteUniProvider,
UniProvider,
Uni,
DAScript,
UniScript,
and for some reason that does the trick - why I don't know
From
SysUtils,
Forms,
Windows,
UniDacVcl,
AccessUniProvider,
MySQLUniProvider,
SQLServerUniProvider,
SQLiteUniProvider,
UniProvider,
Uni,
To
SysUtils,
Forms,
Windows,
MemDS,
DBAccess,
UniDacVcl,
AccessUniProvider,
MySQLUniProvider,
SQLServerUniProvider,
SQLiteUniProvider,
UniProvider,
Uni,
DAScript,
UniScript,
and for some reason that does the trick - why I don't know
