sql-server-2008delphimobileadoconnectionbroadband

General network error on adodb with mobile broadband


We have applications that synchronize some database (sqlserver). Technician Database (SQLExpress 2008 32bit) and on the server side SqlServer 2008 R2 64 bit.

In the synchronize application I to some scripts to sync. the database from the techician to the server. Now I get an errors like [DBNETLIB][ConnectionWrite (send()).]

I've made some log about the error

--21/10/2013 11:05:12------------Update on t_intervention_mission--------------------------------
 Old Values:
   ID=0,RowID={06938E13-F068-437D-A454-3E17B4C7CCC6},IntCardID= NULL,IntCardRowID={69D86DD9-55E5-450F-BC72-93FE2DB5BA1E},MissionID= NULL,MissionRowID={7D1F046F-C82A-42AA-9712-00D4F7FEC5BF},Duration=CONVERT(DATETIME,'1899-12-30 00:00:00.000', 102),Number=1,InCalculation=0,KindID= NULL,KindRowID={D2BD32AD-5926-4AF6-9258-F52F453800A8},WorkTime=0,PayerReference='r',WorkOut=0,ImmovableProperty=1,VatPercent=21,DurationChange=0,DefaultMissionPrice=0,ProductCount=0,DeliverProductPrice=0,DeliverWorkPrice=0,DeliverTransportPrice=0,DeliverMissionPrice=0,DeliverTotalPrice=0,ActiveProductPrice=0,ActiveWorkPrice=0,ActiveTransportPrice=0,ActiveMissionPrice=0,ActiveTotalPrice=0,TariffID= NULL,TariffRowID= NULL,WorkCostPercent=0,WorkCostPlus=0,WorkAmountPercent=0,WorkAmountPlus=0,ProductAmountPercent=0,ProductAmountPlus=0,TransportCostPercent=0,TransportCostPlus=0,TransportAmountPercent=0,TransportAmountPlus=0,MissionAmountPercent=0,MissionAmountPlus=0,DateCreate=CONVERT(DATETIME,'2013-10-21 11:02:36.083', 102),DateChange=CONVERT(DATETIME,'2013-10-21 11:05:00.620', 102),WorkStationCreate='SIX001',WorkStationChange='SIX001',ContractPrice=0,IsSafeCondition= NULL
Script:
   update t_intervention_mission set PayerReference='r',DateChange=CONVERT(DATETIME,'2013-10-21 11:05:00.620', 102) where RowID = '{06938E13-F068-437D-A454-3E17B4C7CCC6}'
--ERROR--EOleException--------------------------------------------------------------------
[DBNETLIB][ConnectionWrite (send()).]Algemene netwerkfout. Raadpleeg de netwerkdocumentatie
 On script:  update t_intervention_mission set PayerReference='r',DateChange=CONVERT(DATETIME,'2013-10-21 11:05:00.620', 102) where RowID = '{06938E13-F068-437D-A454-3E17B4C7CCC6}'

 Connection:AdoConnectionServer
 Number = -2147467259
 NativeError = 11
 Source = Microsoft OLE DB Provider for SQL Server
 Description = [DBNETLIB][ConnectionWrite (send()).]Algemene netwerkfout. Raadpleeg de netwerkdocumentatie.
 Helpfile = 
 SQLState = HY018
 ConnectionTimeOut = 60
 CommandTimeout = 120
--21/10/2013 11:05:41----------------------------------------------------------------

In the log the script want to make an update. I also set a timeless ping in command promp to the sqlserver. When the script execute the update then the ping goes to time out.

this error is only when I have a mobile broadband connection. When the technician arrive to the firm then the laptop find the wifi of the firm and the scripts can be done. The error occure only in a mobile broadband connection.

function TLogFile.SqlExec (StrSql : String; AdoConnection : TADOConnection; ARec: _RecordSet): Integer;
begin
  Result := 0;
  try
    ARec := AdoConnection.Execute(StrSql, cmdText);
  except
    on E : Exception do
    begin
      E.Message:= E.Message+ craConstant.CRLF+
                  'On script: '+StrSql+ craConstant.CRLF+
                  'Connection:'+ AdoConnection.Name;
      if (E.ClassType = EOleException) and (AdoConnection.Errors.Count > 0) then
      begin
        E.Message:= E.Message+ craConstant.CRLF+
                    'Number ='+IntToStr(AdoConnection.Errors[0].Number)+CRLF+
                    'NativeError ='+IntToStr(AdoConnection.Errors[0].NativeError)+CRLF+
                    'Source ='+AdoConnection.Errors[0].Source+CRLF+
                    'Description ='+AdoConnection.Errors[0].Description+CRLF+
                    'Helpfile ='+AdoConnection.Errors[0].HelpFile+CRLF+
                    'SQLState ='+AdoConnection.Errors[0].SQLState;
      end;
      self.HndException:= E;
      Result := -1;

      raise;
    end;
  end;
end;

I did some change in the function sqlexec:

function TLogFile.SqlExec (StrSql : String; AdoConnection : TADOConnection): Integer;
var
  oQuerySql: TADOQuery;
begin
  Result := 0;

  oQuerySql:= TADOQuery.Create(Nil);
  try
    oQuerySql.Connection:= AdoConnection;
    oQuerySql.CommandTimeout:= AdoConnection.CommandTimeout;
    oQuerySql.SQL.Add(StrSql);

    try
      oQuerySql.ExecSQL;
    except
      on E : Exception do
      begin
        E.Message:= E.Message+ craConstant.CRLF+
                    'On script: '+StrSql+ craConstant.CRLF+
                    'Connection:'+ AdoConnection.Name;
        if (E.ClassType = EOleException) and (AdoConnection.Errors.Count > 0) then
        begin
          E.Message:= E.Message+ craConstant.CRLF+
                      'Number = '+IntToStr(AdoConnection.Errors[0].Number)+CRLF+
                      'NativeError = '+IntToStr(AdoConnection.Errors[0].NativeError)+CRLF+
                      'Source = '+AdoConnection.Errors[0].Source+CRLF+
                      'Description = '+AdoConnection.Errors[0].Description+CRLF+
                      'Helpfile = '+AdoConnection.Errors[0].HelpFile+CRLF+
                      'SQLState = '+AdoConnection.Errors[0].SQLState+CRLF+
                      'ConnectionTimeOut = '+IntToStr(AdoConnection.ConnectionTimeout) +CRLF+
                      'CommandTimeout = '+IntToStr(AdoConnection.CommandTimeout);
        end;
        self.HndException:= E;
        Result := -1;

        raise;
      end;
    end;
  finally
    FreeAndNil(oQuerySql);
  end;
end;

This change was OK for 3 days , Now I get back the error on an insert script like

--21/10/2013 14:11:05------------Insert on t_intervention_mission----------------------------------------------------
  Old Values:
  ID=0,RowID={53C5780D-B683-45C9-B942-018091DD0435},IntCardID= NULL,IntCardRowID={0709FB3B-1CDD-4E2B-BAC6-4FB6A952F788},MissionID= NULL,MissionRowID={C24234F2-DD1F-4B3B-B81D-3D13384CC573},Duration=CONVERT(DATETIME,'1899-12-30 00:20:00.000', 102),Number=1,InCalculation=0,KindID= NULL,KindRowID={77387E4C-604A-4653-B490-38A6B9C5A8E5},WorkTime=0,PayerReference= NULL,WorkOut=1,ImmovableProperty=1,VatPercent=0,DurationChange=0,DefaultMissionPrice=0,ProductCount=0,DeliverProductPrice=0,DeliverWorkPrice=0,DeliverTransportPrice=0,DeliverMissionPrice=0,DeliverTotalPrice=0,ActiveProductPrice=0,ActiveWorkPrice=13.54,ActiveTransportPrice=11.01,ActiveMissionPrice=0,ActiveTotalPrice=24.55,TariffID= NULL,TariffRowID={DADB09D9-A760-4213-98AA-47E090EAB1FD},WorkCostPercent=0,WorkCostPlus=0,WorkAmountPercent=30,WorkAmountPlus=0,ProductAmountPercent=0,ProductAmountPlus=0,TransportCostPercent=0,TransportCostPlus=0,TransportAmountPercent=0,TransportAmountPlus=0,MissionAmountPercent=0,MissionAmountPlus=0,DateCreate=CONVERT(DATETIME,'2013-09-02 08:37:54.530', 102),DateChange=CONVERT(DATETIME,'2013-09-02 08:38:06.460', 102),WorkStationCreate='SIX001',WorkStationChange='SIX001',ContractPrice=0,IsSafeCondition= NULL
 Script:
   insert into t_intervention_mission     (RowID,IntCardRowID,MissionRowID,Duration,Number,InCalculation,KindRowID,WorkTime,WorkOut,ImmovableProperty,VatPercent,DurationChange,DefaultMissionPrice,ProductCount,DeliverProductPrice,DeliverWorkPrice,DeliverTransportPrice,DeliverMissionPrice,DeliverTotalPrice,ActiveProductPrice,ActiveWorkPrice,ActiveTransportPrice,ActiveMissionPrice,ActiveTotalPrice,TariffRowID,WorkCostPercent,WorkCostPlus,WorkAmountPercent,WorkAmountPlus,ProductAmountPercent,ProductAmountPlus,TransportCostPercent,TransportCostPlus,TransportAmountPercent,TransportAmountPlus,MissionAmountPercent,MissionAmountPlus,DateCreate,DateChange,WorkStationCreate,WorkStationChange,ContractPrice) values ('{53C5780D-B683-45C9-B942-018091DD0435}','{0709FB3B-1CDD-4E2B-BAC6-4FB6A952F788}','{C24234F2-DD1F-4B3B-B81D-3D13384CC573}',CONVERT(DATETIME,'1899-12-30 00:20:00.000', 102),1,0,'{77387E4C-604A-4653-B490-38A6B9C5A8E5}',0,1,1,0,0,0,0,0,0,0,0,0,0,13.54,11.01,0,24.55,'{DADB09D9-A760-4213-98AA-47E090EAB1FD}',0,0,30,0,0,0,0,0,0,0,0,0,CONVERT(DATETIME,'2013-09-02 08:37:54.530', 102),CONVERT(DATETIME,'2013-09-02 08:38:06.460', 102),'SIX001','SIX001',0)
--ERROR--EOleException--------------------------------------------------------------------
[DBNETLIB][ConnectionWrite (send()).]Algemene netwerkfout. Raadpleeg de netwerkdocumentatie
On script:  insert into t_intervention_mission (RowID,IntCardRowID,MissionRowID,Duration,Number,InCalculation,KindRowID,WorkTime,WorkOut,ImmovableProperty,VatPercent,DurationChange,DefaultMissionPrice,ProductCount,DeliverProductPrice,DeliverWorkPrice,DeliverTransportPrice,DeliverMissionPrice,DeliverTotalPrice,ActiveProductPrice,ActiveWorkPrice,ActiveTransportPrice,ActiveMissionPrice,ActiveTotalPrice,TariffRowID,WorkCostPercent,WorkCostPlus,WorkAmountPercent,WorkAmountPlus,ProductAmountPercent,ProductAmountPlus,TransportCostPercent,TransportCostPlus,TransportAmountPercent,TransportAmountPlus,MissionAmountPercent,MissionAmountPlus,DateCreate,DateChange,WorkStationCreate,WorkStationChange,ContractPrice) values ('{53C5780D-B683-45C9-B942-018091DD0435}','{0709FB3B-1CDD-4E2B-BAC6-4FB6A952F788}','{C24234F2-DD1F-4B3B-B81D-3D13384CC573}',CONVERT(DATETIME,'1899-12-30 00:20:00.000', 102),1,0,'{77387E4C-604A-4653-B490-38A6B9C5A8E5}',0,1,1,0,0,0,0,0,0,0,0,0,0,13.54,11.01,0,24.55,'{DADB09D9-A760-4213-98AA-47E090EAB1FD}',0,0,30,0,0,0,0,0,0,0,0,0,CONVERT(DATETIME,'2013-09-02 08:37:54.530', 102),CONVERT(DATETIME,'2013-09-02 08:38:06.460', 102),'SIX001','SIX001',0)
Connection:AdoConnectionServer
Number =-2147467259
NativeError =11
Source =Microsoft OLE DB Provider for SQL Server
Description =[DBNETLIB][ConnectionWrite (send()).]Algemene netwerkfout. Raadpleeg de netwerkdocumentatie.
Helpfile =
SQLState =HY018
--21/10/2013 14:11:37----------------------------------------------------------------

I get to the technician on the floor. I run the old synchro app with the old function TLogFile.SqlExec (StrSql : String; AdoConnection : TADOConnection; ARec: _RecordSet): Integer; and the script doesn't give me an error. What is wrong about the AdoConnection.Execute(StrSql, cmdText) VS oQuerySql.ExecSQL; The adoconnection and the scripts are done in a thread.

On older laptops (Windows XP), I don't have this issue. Only for the new laptop with Windows7.

If someone can give me some clarification or tips where to search the problem. I will appreciated it. Is there also diffence between 'SQL Server Native Client 10.0' and 'Microsoft OLE DB Provider for SQL Server'.

For the synchronization I use the 'Microsoft OLE DB Provider for SQL Server'


Solution

  • I ask the problem to the firm of the laptops (Panasonic). Panasonic give me a Firmware update and driver installation and this solve the problem. I don't get the network error anymore.