Question : Delphi Runtime Packages

Hi,

I am building my program with the runtime package of Advantage Version 8, when I execute it and try to do a request everything works fine.

I want to know if it's possible to deliver a .exe which would execute even though the client has version 8 or 9 of Advantage without having to recompile the .exe.

Exemple: I build my .exe with the runtime package of Advantage version 9, I deliver it to the client whom has already the package of Advantage version 8, will my .exe adjust to that version and execute?

 

Answer : Delphi Runtime Packages

My main goal is to have only one .exe with which would be built with Advantage 9, and I would like it to also be able to execute with Advantage 8...

There is still a means by which you can (sort of) do what you are trying to do.  It is a bit more work but it could be a "work around."

  1. First move your data access into a Datamodule, if you haven't already.  
     
  2. Then create a version of the Datamodule that is specific to each of the Advantage versions ,i.e. they must be exactly parallel/identical except for the connection strings and cnoonections to the different versions of Advantage.  They must have the same function/procedures that accept the same parameters and return the same results (in the case of functions) and do the same things.  It also means that you need to have all of the datasources and queries and all of the other data access components named the same in each datamodule.
     
  3. The DLLs in 2) above will have to be "dynamically loaded" DLL's (which is where the "a bit more work" really comes into the picture.
     
  4. That also means that you'll need a procedure in your main app that will load and connect up the appropriate DataModule DLL.
     
  5. You will then need to have a way to identify which ever Advantage version the client has.  That will let you load the appropriate DataModule DLL. 

I've done this in the past when I had to be able to switch hit between DB2, SQL Server, and Oracle.  (At least, theoretically, your situation is all in one family. ;-)  

Alternatively, I have connected to either SQL Server Express (locally) or SQL Server (on a network) by simply setting up the connection strings for each and then having the application try to make the connection to the network SQL Server and then, if that won't work, try the local SQL Server Express.  This approach could probably be modified so that it could work with your variation on the theme.  

Depending on exactly which connection components you are using, you may be able to use the same trick I did when I didn' tknow what the network or local connection would look like.  I created a procedure in my datamodule that walked the user through creating the connection string and then saved that.

Random Solutions  
 
programming4us programming4us