Windows 7 and Access

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Windows 7 and Access

Post by oz8hp » 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;

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Post by oz8hp » Fri 05 Mar 2010 05:50

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 :)

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 05 Mar 2010 15:24

It seems that you have connected to different databases form Windows XP and Windows 7 machines.

oz8hp
Posts: 151
Joined: Mon 18 Feb 2008 13:28
Location: Denmark
Contact:

Post by oz8hp » Sat 06 Mar 2010 11:15

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.

Post Reply