Part of the code is as follows:
If edit1. Text<> "' then
The begin
Memo1. Lines. The Add (");
Memo1. Lines. The Add (' high frequency module);
IdIcmpClient1. Host:=Edit1. Text;
IdIcmpClient1. ReceiveTimeout:=1000;
For the Enabled:=false;
Try
For I:=0 to 1 do
The begin
IdIcmpClient1. Ping;
If (IdIcmpClient1. ReplyStatus. BytesReceived=0) or (IdIcmpClient1. ReplyStatus. TimeToLive=0) then
The begin
With ADOQuery1 do
The begin
{ADOQuery1. Close;
ADOQuery1. SQL. The Clear;
ADOQuery1. SQL. Text:='Update cbat SET state 1="0" where id=' + idh.
ADOQuery1. ExecSQL;
ADOQuery1. Close;
ADOQuery1. SQL. The Clear;
ADOQuery1. SQL. The Add (' select * from cbat order by id ");
ADOQuery1. Open;
ADOQuery1. Locate (' id 'strtoint (idh), [loPartialKey]);
ADOQuery1. EnableControls;
}
ADOQuery1. Open;
ADOQuery1. Edit;
ADOQuery1. FieldByName (' state 1) value:='0';
ADOQuery1. Post;
end;
End
The else
The begin
With ADOQuery1 do
The begin
{ADOQuery1. Close;
ADOQuery1. SQL. The Clear;
ADOQuery1. SQL. Text:='Update cbat SET 1="1" state where id=' + idh.
ADOQuery1. ExecSQL;
ADOQuery1. Close;
ADOQuery1. SQL. The Clear;
ADOQuery1. SQL. The Add (' select * from cbat order by id ");
ADOQuery1. Open;
ADOQuery1. Locate (' id 'strtoint (idh), [loPartialKey]);
ADOQuery1. EnableControls;
}
ADOQuery1. Open;
ADOQuery1. Edit;
ADOQuery1. FieldByName (' state 1) value:='1';
ADOQuery1. Post;
end;
end;
Application. ProcessMessages;
end;
The finally
For the Enabled:=true;
end;
end;
CodePudding user response:
Forgot to say with delphi7 developmentCodePudding user response:
Can be related to the Windows 7 systemCodePudding user response:
Estimates that it doesn't matter I also have the Windows 7 no problem completelyCodePudding user response:
Attempts to invalid, hope ace to guideCodePudding user response:
Basically can determine the post can only modify ADOQuery table, did not change the databaseCodePudding user response:
Windows 7 failure. Don't runCodePudding user response:
Your statement is just modify the first data of the state of '1', rather than specify the ID of the row data 'state 1'CodePudding user response:
Adoquery1. UpdateBatch (arall); Try to use thisCodePudding user response:
ADOQuery1. SQL. Text:='Update cbat SET state 1="0" where id=' + idh.1="0" should be state 1=' '0'
'0 respectively with two single quotes on both sides
In addition,
With ADOQuery1 do
The begin
ADOQuery1. Close;//ADOQuery1 can omit
The Close;//this can, with.. Do statement of purpose is to omit
.
end;
CodePudding user response:
What is selected locktype!!!!!!CodePudding user response:
Look at the data set is modified, additional price updatebatch (arall) tryCodePudding user response:
Through ADOConnection connect to the database, the SQL update operation, Post the statement of a data set that can only update the DBGrid data,CodePudding user response:
If use the cached data model, you need to use the caching pattern to submit, Post submission is submitted to the cache, not submit to the database, to be submitted to the database, need a ApplyUpdate etc. FunctionCodePudding user response:
Simple look under theAnd didn't see you for a little, you don't have a positioning line, maybe I don't think the carefully;
Second, database field don't use Chinese as far as possible;
Three, some Settings and Windows 7 XP is not the same, such as the date format will cause the entire software;
Four, adoquery besides query and so on must be set, do not change any Settings, such as locktype
Five, pay attention to your query, the query results in different environments have different effect, if you want to edit the data directly, to avoid the joint query, including federated query view,
CodePudding user response:
Using ado. UpdateBatch (arall);CodePudding user response:
POS seemingly will only update the DBGRID, try applyupdates lookCodePudding user response:
After the OPEN add FIRST, namely:With ADOQuery1 do
The begin
The Open;
First;
Edit;
.
Post;
end;
CodePudding user response:
Thank you teacher, recently busy, first temporarily in UPDATE mode, teachers took the time to verify the proposalCodePudding user response:
Has been completely give up the POST, I felt that this is absolutely a BUG, with test program test alone, useful, an added to the system, the problem it strange that search online method, basic is not available, is insane, simply don't have to,CodePudding user response:
Return E_FAIL status, basically be the ADO drive OLEDB, suggested by installing MYSQL ODBC, through ODBC to connect again,