I try to debug the following problem for several weeks - this method is called from several places within the same module date, but this exception (from the subject line of this message) occurs only when integers for a specific purpose (orders and orders that we send through the carrier) are used - and do not ask me how the application can distinguish one whole destination from another! In addition, I cannot duplicate this problem on my machine - an error occurs on the warehouse machine, but not on my own development machine, even when working with the same production database. I suspected that there was a conflict of MDAC versions between the two machines, but I launched a version check and confirmed that both machines are working on 2.8, and in addition, confirmed this by registering the TAdoDataset property.Version at runtime.
function TdmESShip.SecondaryID(const PrimaryID : Integer ): String;
begin
try
with qESPackage2 do
begin
if Active then
Close;
LogMessage('-----------------------------------');
LogMessage('Version: ' + FConnection.Version);
LogMessage('DB Info: ' + FConnection.Properties['Initial Catalog'].Value + ' ' + FConnection.Properties['Data Source'].Value);
LogMessage('Setting the parameter.');
Parameters.ParamByName('ParameterName').Value := PrimaryID;
LogMessage('Done setting the parameter.');
Open;
Ninety-nine times out of 100, this registration code records a successful operation as follows:
Version: 2.8 DB Info: (database name and instance)Parameter setting.
Ready to set the parameter.
Opened a data set.
But then whenever a pickup order is processed, this exception is thrown whenever a data set is opened:
Version: 2.8Database Information: (database name and instance)
Parameter setting.
Ready to set the parameter.
GetESPackageID () threw an exception. Type: EOleException, Message: The arguments are of the wrong type, are out of range, or are in conflict with each other. Error. Arguments are of the wrong type, are out of range, or are in conflict with each other for packageID 10813711
, , TParameter , . TParameter, - TParameter, , . , - .dfm , .
-select ValueA from TableName where ValueB = @ParameterB
- , , -, - , , , , , , , , , , - . , , , .