Windows 7 and Access
Posted: Thu 04 Mar 2010 13:58
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;
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;