我們有一些同步某些數據庫(sqlserver)的應用程序。 技術人員數據庫(SQLExpress 2008 32位)和服務器端SqlServer 2008 R2 64位。使用移動寬帶的adodb上的一般網絡錯誤
在同步應用程序中我要同步一些腳本。從技術人員到服務器的數據庫。 現在我得到這樣的[DBNETLIB]的錯誤[ConnectionWrite(發送())。]
我做了一些日誌有關錯誤
--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----------------------------------------------------------------
在登錄腳本要進行更新。 我還設置了一個永恆的ping命令promp到sqlserver。 腳本執行更新時,ping會超時。
這個錯誤是隻有當我有一個移動寬帶連接。 當技術人員到達公司後,筆記本電腦找到公司的無線網絡,腳本可以完成。 該錯誤僅在移動寬帶連接中出現。
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;
我的確在功能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;
這種變化是3天好了,現在我回來上插入腳本錯誤,如
--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----------------------------------------------------------------
我去找地板上的技術員。我使用舊函數TLogFile.SqlExec(StrSql:String; AdoConnection:TADOConnection; ARec:_RecordSet)運行舊同步應用程序:Integer; 和腳本不會給我一個錯誤。 AdoConnection.Execute(StrSql,cmdText)VS oQuerySql.ExecSQL有什麼問題; adoconnection和腳本是在一個線程中完成的。
在較舊的筆記本電腦(Windows XP)上,我沒有這個問題。 僅適用於裝有Windows7的新筆記本電腦。
如果有人可以給我一些澄清或提示在哪裏搜索問題。我會欣賞它。 「SQL Server Native Client 10.0」和「Microsoft OLE DB Provider for SQL Server」之間是否存在差異?
因爲我使用「Microsoft OLE DB提供用於SQL Server」
好吧,只是爲了讓大家驚歎,SQL本機客戶端(SQLNCLI)沒有預先安裝在Windows中。諸如Visual Studio或SQL Server之類的東西可能會安裝它,但它不包含在Windows中。 –
@JerryDodge:我已經將代碼更改爲SQLNCLI。謝謝你的提示。我將回滾代碼並僅使用SQLOLEDB.1 – Ravaut123
這是否有助於解決您的問題? –