D
DelphiBB
Unregistered / Unconfirmed
GUEST, unregistred user!
在一个query里有:
SELECT Liverecord.RecordIdx, Roomgrade.GradeName, Liverecord.RoomNo, Liverecord.UserIdx, Userinfo.Name AS UserName, Userinfo.SexMale, Userinfo.Partners, Liverecord.LoginDate, Liverecord.WaiterID, Waiterinfo.Name AS WaiterName, Roominfo.RoomTel
FROM LiveRecord Liverecord, RoomInfo Roominfo, UserInfo Userinfo, WaiterInfo Waiterinfo, RoomGrade Roomgrade
WHERE (Roominfo.RoomNo = Liverecord.RoomNo)
AND (Roominfo.GradeNo = Roomgrade.GradeNo)
AND (Liverecord.UserIdx = Userinfo.UserIdx)
AND (Liverecord.WaiterID = Waiterinfo.WaiterID)
AND (Liverecord.InUse = TRUE)
Order By :Order;
在程序用有一菜单,动态替换Order 参数
比如:
procedure TMainForm.ActionByLogInDateExecute(Sender: TObject);
begin
with DATA.QueryMain do
begin
close;
ParamByName('Order').Value :='LiveRecord.LoginDate';
Open;
OrderLabel.Caption:='按日期排序';
end;
end;
procedure TMainForm.ActionByRoomNoExecute(Sender: TObject);
begin
with DATA.QueryMain do
begin
Close;
ParamByName('Order').AsString :='Liverecord.RoomNo';
Open;
OrderLabel.Caption:='按房间排序';
end;
end;
procedure TMainForm.ActionByDefaultExecute(Sender: TObject);
begin
with DATA.QueryMain do
begin
Close;
ParamByName'Order').AsString :='Liverecord.RecordIdx';
Open;
OrderLabel.Caption:='按默认排序';
end;
end;
为什么我在改变Order后数据没有照我希望的去派学?
还有一个问题就是如何用InsertRecord中的自增字段?
SELECT Liverecord.RecordIdx, Roomgrade.GradeName, Liverecord.RoomNo, Liverecord.UserIdx, Userinfo.Name AS UserName, Userinfo.SexMale, Userinfo.Partners, Liverecord.LoginDate, Liverecord.WaiterID, Waiterinfo.Name AS WaiterName, Roominfo.RoomTel
FROM LiveRecord Liverecord, RoomInfo Roominfo, UserInfo Userinfo, WaiterInfo Waiterinfo, RoomGrade Roomgrade
WHERE (Roominfo.RoomNo = Liverecord.RoomNo)
AND (Roominfo.GradeNo = Roomgrade.GradeNo)
AND (Liverecord.UserIdx = Userinfo.UserIdx)
AND (Liverecord.WaiterID = Waiterinfo.WaiterID)
AND (Liverecord.InUse = TRUE)
Order By :Order;
在程序用有一菜单,动态替换Order 参数
比如:
procedure TMainForm.ActionByLogInDateExecute(Sender: TObject);
begin
with DATA.QueryMain do
begin
close;
ParamByName('Order').Value :='LiveRecord.LoginDate';
Open;
OrderLabel.Caption:='按日期排序';
end;
end;
procedure TMainForm.ActionByRoomNoExecute(Sender: TObject);
begin
with DATA.QueryMain do
begin
Close;
ParamByName('Order').AsString :='Liverecord.RoomNo';
Open;
OrderLabel.Caption:='按房间排序';
end;
end;
procedure TMainForm.ActionByDefaultExecute(Sender: TObject);
begin
with DATA.QueryMain do
begin
Close;
ParamByName'Order').AsString :='Liverecord.RecordIdx';
Open;
OrderLabel.Caption:='按默认排序';
end;
end;
为什么我在改变Order后数据没有照我希望的去派学?
还有一个问题就是如何用InsertRecord中的自增字段?