1、可以用DBNavigator联接数据源做删除
2、stringgrid行列的增加和删除
type
TExCell = class(TStringGrid)
public
procedure DeleteRow(ARow: Longint);
procedure DeleteColumn(ACol: Longint);
procedure InsertRow(ARow: LongInt);
procedure InsertColumn(ACol: LongInt);
end;procedure TExCell.InsertColumn(ACol: Integer);
begin
ColCount :=ColCount +1;
MoveColumn(ColCount-1, ACol);
end;procedure TExCell.InsertRow(ARow: Integer);
begin
RowCount :=RowCount +1;
MoveRow(RowCount-1, ARow);
end;procedure TExCell.DeleteColumn(ACol: Longint);
begin
MoveColumn(ACol, ColCount -1);
ColCount := ColCount - 1;
end;procedure TExCell.DeleteRow(ARow: Longint);
begin
MoveRow(ARow, RowCount - 1);
RowCount := RowCount - 1;
end;
3、DBGrid和Query联接同一个数据源
4、用SQL语句:
CREATE TABLE 表名
(
字段ID int not null IDENTITY,
字段1 varchar(16) primary key,
字段2 varchar(100) not null,
......
字段n varchar(100) not null )
5、你想怎么备份,有哪些数据要备份
2、stringgrid行列的增加和删除
type
TExCell = class(TStringGrid)
public
procedure DeleteRow(ARow: Longint);
procedure DeleteColumn(ACol: Longint);
procedure InsertRow(ARow: LongInt);
procedure InsertColumn(ACol: LongInt);
end;procedure TExCell.InsertColumn(ACol: Integer);
begin
ColCount :=ColCount +1;
MoveColumn(ColCount-1, ACol);
end;procedure TExCell.InsertRow(ARow: Integer);
begin
RowCount :=RowCount +1;
MoveRow(RowCount-1, ARow);
end;procedure TExCell.DeleteColumn(ACol: Longint);
begin
MoveColumn(ACol, ColCount -1);
ColCount := ColCount - 1;
end;procedure TExCell.DeleteRow(ARow: Longint);
begin
MoveRow(ARow, RowCount - 1);
RowCount := RowCount - 1;
end;
3、DBGrid和Query联接同一个数据源
4、用SQL语句:
CREATE TABLE 表名
(
字段ID int not null IDENTITY,
字段1 varchar(16) primary key,
字段2 varchar(100) not null,
......
字段n varchar(100) not null )
5、你想怎么备份,有哪些数据要备份
解决方案 »
- 怎样获取Treeview一个节点的父节点?
- 出现“[Fatal Error] Project1.dpr(1): File not found: 'SysInit.pas'”是什么原因
- 使用WebBrowser+Timer+ADO保存數據時為何會報錯?
- DELPHI7中使用corba时,编译IDL语言总是出“找不到指定文件”的错误
- 你们是怎么调试程序的?!
- 关于对象的parent问题。。。分不多请各位
- 看李维的书很有成就感
- delphi中调用API时怎么知道应用传递什么参数?有没有VB 中的API浏览器那样的工具?
- 哪位英雄可以解答这个问题(算是比较有难度的)
- delphi中如何实现汉字分行问题
- 谁能详细介绍一下财务或进销存软件中“帐套”的意思,相关的数据结构怎么制定?
- 要命呀,公司要我在一个星期之内掌握delphi+Oralce,两个月做出一个生产管理系统,有没有可能?
TExCell = class(TStringGrid)
public
procedure DeleteRow(ARow: Longint);
procedure DeleteColumn(ACol: Longint);
procedure InsertRow(ARow: LongInt);
procedure InsertColumn(ACol: LongInt);
end;procedure TExCell.InsertColumn(ACol: Integer);
begin
ColCount :=ColCount +1;
MoveColumn(ColCount-1, ACol);
end;procedure TExCell.InsertRow(ARow: Integer);
begin
RowCount :=RowCount +1;
MoveRow(RowCount-1, ARow);
end;procedure TExCell.DeleteColumn(ACol: Longint);
begin
MoveColumn(ACol, ColCount -1);
ColCount := ColCount - 1;
end;procedure TExCell.DeleteRow(ARow: Longint);
begin
MoveRow(ARow, RowCount - 1);
RowCount := RowCount - 1;
end;3、用一个Tdatasource,
Dbgrid1.datasource:=Datasource1;
datasource1.dataset:=query1;就行了。
4、例
CREATE TABLE jobs
(
job_id smallint PRIMARY KEY CLUSTERED,
job_desc varchar(50) NOT NULL
min_lvl tinyint NOT NULL
max_lvl tinyint NOT NULL
)
5、在程序中把它倒出来,sql的表文件是看不到的。
TExCell = class(TStringGrid)
public
procedure DeleteRow(ARow: Longint);
procedure DeleteColumn(ACol: Longint);
procedure InsertRow(ARow: LongInt);
procedure InsertColumn(ACol: LongInt);
end;procedure TExCell.InsertColumn(ACol: Integer);
begin
ColCount :=ColCount +1;
MoveColumn(ColCount-1, ACol);
end;procedure TExCell.InsertRow(ARow: Integer);
begin
RowCount :=RowCount +1;
MoveRow(RowCount-1, ARow);
end;procedure TExCell.DeleteColumn(ACol: Longint);
begin
MoveColumn(ACol, ColCount -1);
ColCount := ColCount - 1;
end;procedure TExCell.DeleteRow(ARow: Longint);
begin
MoveRow(ARow, RowCount - 1);
RowCount := RowCount - 1;
end;3、用一个Tdatasource,
Dbgrid1.datasource:=Datasource1;
datasource1.dataset:=query1;就行了。
4、例
CREATE TABLE jobs
(
job_id smallint PRIMARY KEY CLUSTERED,
job_desc varchar(50) NOT NULL
min_lvl tinyint NOT NULL
max_lvl tinyint NOT NULL
)
5、在程序中把它倒出来,sql的表文件是看不到的。
2、楼上的较详细。其实就是把行数加一,然后将原来的行后移(对列的操作类似);
3、DBGrid1.DataSource := DataSource1;
DataSource1.DataSet := Query1;
4、执行SQL是较好的方法,当然也可以使用TTABLE来建表。具体做法请参照TTABLE的帮助。
5、可以使用BCP命令,将所有表的数据备份出来,再使用SQL DEMO组件还可以导出表结构。我前段时间做了一个这样的专门用来备份SQL SERVER的工具(还未完善)。需要的话留下EMAIL。
也可以直接使用SQL SERVER自己的备份。但可能不支持远程文件。
1.我想做一个删除按钮
2。不明白,自定义过程如何用,另外,我想删除焦点项如何做?
3。我连了,能编译DBGrid上无数据。。
4。。
5。对数据备份这里我也没想好,是备份表,还是数据库,给点意见》》》
E_Mail:[email protected]
谢谢支持!!!!!!!!
删除按钮的Click事件里添加代码
procedure TForm1.Button1Click(Sender: TObject);
begin
...
DBGrid1.DataSource.DataSet.Delete; //这样就会删除DBGrid焦点项的记录
//DBGrid1.DataSource.DataSet.Active := False;
//DBGrid1.DataSource.DataSet.Active := True;
...
end;
3.查看你的TDBGrid的DataSource属性以及TDataSource的DataSet属性,如果是用TTable或TQuery的Active属性
4...
5.一般是备份数据库