M
me_x
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.bPostClick(Sender: TObject); //更新记录
var p: ^boolean;
begin
p := @(MQuery.FieldByName('CompanyName').ReadOnly);
p^ := True;
MQuery.Post;
p^ := False;
MQuery.UpdateBatch;
end;
procedure TForm1.MQueryAfterOpen(DataSet: TDataSet);
begin
MQuery.Properties['Unique Table'].Value := 'Orders';
MQuery.Properties['Resync Command'].Value :=
'Select * From (Select OrderID, Orders.CustomerID, CompanyName
+ ' From Orders, Customers '
+ ' Where Orders.CustomerID = Customers.CustomerID'
+ ' and OrderID between 11000 and 11011) a'
+ ' Where a.OrderID = ?';
MQuery.Properties['Update Resync'].Value := adResyncAll;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
MQuery.SQL.Text := 'Select OrderID, Orders.CustomerID, CompanyName'
+ ' from Orders, Customers'
+ ' where Orders.CustomerID = Customers.CustomerID'
+ ' and OrderID between 11000 and 11011';
end;
initialization
CoInitialize(Nil);
finalization
CoUnInitialize;
只能在Delphi5下通过
var p: ^boolean;
begin
p := @(MQuery.FieldByName('CompanyName').ReadOnly);
p^ := True;
MQuery.Post;
p^ := False;
MQuery.UpdateBatch;
end;
procedure TForm1.MQueryAfterOpen(DataSet: TDataSet);
begin
MQuery.Properties['Unique Table'].Value := 'Orders';
MQuery.Properties['Resync Command'].Value :=
'Select * From (Select OrderID, Orders.CustomerID, CompanyName
+ ' From Orders, Customers '
+ ' Where Orders.CustomerID = Customers.CustomerID'
+ ' and OrderID between 11000 and 11011) a'
+ ' Where a.OrderID = ?';
MQuery.Properties['Update Resync'].Value := adResyncAll;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
MQuery.SQL.Text := 'Select OrderID, Orders.CustomerID, CompanyName'
+ ' from Orders, Customers'
+ ' where Orders.CustomerID = Customers.CustomerID'
+ ' and OrderID between 11000 and 11011';
end;
initialization
CoInitialize(Nil);
finalization
CoUnInitialize;
只能在Delphi5下通过