我想把我选种的dbgrid中的一行数据移动到上一行,该怎么写代码啊
保存以后数据库中的次数是不是和他是 一样的呢,求解
保存以后数据库中的次数是不是和他是 一样的呢,求解
解决方案 »
- mysql 连接问题
- 双击Events为什么无法添加事件?
- .dat数据库文件内容,如何显示在表格中?望高手指点一下!
- 求救:请问这个错误怎么解决:[Error]:Invalid compiler directive: 'EXTERNAL'
- 各位老大,做ftp客户端程序,如何遍历ftp服务器上某一个目录下所有的文件?
- 请各位高手帮一个忙.关于一个远程抓屏的问题急,急....
- 那里可以下的到DDK阿,还有Delphi到底能不能开发驱动阿?
- 在dephi7.0 中使用控件WebBrowser只能打开一个页面,按第二个按钮的时候要重新登陆
- Delphi高手请进...
- 请问delphi5.0的补丁程序在哪有下载!
- 这个错误是代表什么意思啊?!
- 如何获取和设置打印机?
procedure TFplzj.bsSkinDBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TbsColumn;
State: TGridDrawState);
begin
if startselect then
begin
if endselect then
begin
if (table1.RecNo>=startrecord)and(table1.RecNo<=endrecord) then
begin
with self.bsSkinDBGrid1 do
begin
canvas.Font.Color:=clyellow;
canvas.Brush.Color:=clnavy;
defaultdrawcolumncell(rect,datacol,column,state);
end;
end;
end else
begin
if table1.RecNo=startrecord then
begin
with self.bsSkinDBGrid1 do
begin
canvas.Font.Color:=clyellow;
canvas.Brush.Color:=clnavy;
defaultdrawcolumncell(rect,datacol,column,state);
end
end;
end;
end;
end;
procedure TFstudent.bsSkinSpeedButton1Click(Sender: TObject);
var
str,str1:string;
begin///向上
if dm.ADOTstudent.RecordCount>1 then
begin
str:=dm.ADOTstudent.fieldbyname('姓名').AsString;
dm.ADOTstudent.Prior;
if not dm.ADOTstudent.Bof then
begin
str1:=dm.ADOTstudent.fieldbyname('姓名').AsString;
dm.ADOTstudent.Edit;
dm.ADOTstudent.FieldByName('姓名').AsString:=str;
dm.ADOTstudent.Post;
dm.ADOTstudent.Next;
dm.ADOTstudent.Edit;
dm.ADOTstudent.FieldByName('姓名').AsString:=str1;
dm.ADOTstudent.Post;
dm.ADOTstudent.Prior;
end;
end;
end;procedure TFstudent.bsSkinSpeedButton2Click(Sender: TObject);
var
str,str1:string;
begin//向下
if dm.ADOTstudent.RecordCount>1 then
begin
str:=dm.ADOTstudent.fieldbyname('姓名').AsString;
dm.ADOTstudent.Next;
if not dm.ADOTstudent.Eof then
begin
str1:=dm.ADOTstudent.fieldbyname('姓名').AsString;
dm.ADOTstudent.Edit;
dm.ADOTstudent.FieldByName('姓名').AsString:=str;
dm.ADOTstudent.Post;
dm.ADOTstudent.Prior;
dm.ADOTstudent.Edit;
dm.ADOTstudent.FieldByName('姓名').AsString:=str1;
dm.ADOTstudent.Post;
dm.ADOTstudent.Next;
end;
end;
end;