determine SDAC version

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Ludek

determine SDAC version

Post by Ludek » Mon 03 Oct 2005 11:20

Is there a way to determine SDAC version at compile time and, if the version is too low, generate an error? Something like {$IF SDACVer < 3550017} ... {$ENDIF}

Or do I need to parse the SDACVersion string variable at run-time? :-(

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 03 Oct 2005 14:59

You can't do this at compile time

Ludek

Post by Ludek » Mon 03 Oct 2005 16:19

Do you plan to include such feature in next versions? I think it shouldn't be complicated... Or at least an other constant/variable, that would be easily comparable without complicated parsing...

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 04 Oct 2005 09:26

Please describe in details what you need it for.

Ludek

Post by Ludek » Tue 04 Oct 2005 11:20

I simply want to be sure, that nobody compiles the sources and uses the program compiled with too old SDAC version - if some important bug in SDAC gets corrected, each workstation that compiles the sources will be forced to update SDAC. And I don't also want to force to update all workstations, when the corrected bug wasn't important.
Example: I Want to let compile our current sources with SDAC 3.55.0.17 or higher, never with 3.55.0.16 or lower.

Ludek

Post by Ludek » Tue 04 Oct 2005 14:30

I really don't like writing complex algorithms like this

Code: Select all

function SDACVersionHighEnough: boolean;
const
  ReqSDACVer: array [0..3] of integer = (3, 55, 0, 17);
var
  currindex: integer;
  currnumber: integer;
  strpos: integer;
begin
  currindex := 0;
  currnumber := 0;
  for strpos := 1 to length(SDACVersion) do begin
    case SDACVersion[strpos] of
      '.': begin
        assert(currindex  ReqSDACVer[currindex] then begin
          result := true;
          exit;
        end else if currnumber = ReqSDACVer[currindex];
end;
if not absolutely necessary :( :x :cry:
I would like following:

Code: Select all

if SDACVersionNum < 3550017 then ...
do you see the difference? :twisted:

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 06 Oct 2005 08:23

Do you distribute components, based on SDAC? Or is there another purpose?

Ludek

Post by Ludek » Tue 25 Oct 2005 10:59

No, I don't distribute components. As already many times said - I simply want to be sure, that nobody in our company compiles sources with a wrong version of SDAC (for examples, if the programmer comes from holiday, he sees immediately, he has to update SDAC).

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 01 Nov 2005 08:52

We will think about adding such variable. But it looks hardly necessary.

Post Reply