Page 1 of 1

Windows 7 and Access

Posted: Thu 04 Mar 2010 13:58
by oz8hp
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;

Posted: Fri 05 Mar 2010 05:50
by oz8hp
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 :)

Posted: Fri 05 Mar 2010 15:24
by Dimon
It seems that you have connected to different databases form Windows XP and Windows 7 machines.

Posted: Sat 06 Mar 2010 11:15
by oz8hp
That is not the case:
Both installations are just OS - no other programs running.
The .exe and .mdb files are the same files copied to both computers (they are in fact VMWare machines)
And the error was corrected on Windows 7 by changing the uses list and nothing else.