社区
数据库相关
帖子详情
Delphi的DataSet,DataSource,DBGrid是如何协同工作的?
goldli
2010-04-02 12:42:23
如题。
一个DBGrid在连接到一个DataSource,此DataSource连接到一个dataset,在激活dataSet的情况下,DBGrid可以显示查询到的内容。而修改DBGrid的值会返应到数据库中。
设,控件使用ADO方式,那么它们是如何连动的?
...全文
622
6
打赏
收藏
Delphi的DataSet,DataSource,DBGrid是如何协同工作的?
如题。 一个DBGrid在连接到一个DataSource,此DataSource连接到一个dataset,在激活dataSet的情况下,DBGrid可以显示查询到的内容。而修改DBGrid的值会返应到数据库中。 设,控件使用ADO方式,那么它们是如何连动的?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
6 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
udxiaos
2010-05-25
打赏
举报
回复
换了家公司刚开始用delphi,悲剧ing
yuweihua86
2010-04-05
打赏
举报
回复
随便去网上找找,这方面的资料一大堆呢
bdmh
2010-04-02
打赏
举报
回复
不明白你要弄清楚什么问题
CACACACACA
2010-04-02
打赏
举报
回复
看TDataLink,
goldli
2010-04-02
打赏
举报
回复
例
一个adoquery连接到一个adoconnection上,将一个datasource连接到adoquery上,把dbgrid连接到datasource然后active adoquery,如果adoquery的sql有值,且能查询到内容,则这些内容会反应到dbgrid里。修改dbgrid一个单元格的内容,这个内容会反应到数据库里。我想问的是,这几个控件是如何实现由查询到表格,表格修改过自动存储的。
金卯刀
2010-04-02
打赏
举报
回复
看source比別人講,會更清楚!
Delphi
如何一次删除
db
grid
多条记录的例子.rar
Delphi
演示如何一次删除网格数据表
db
grid
中的多条记录,小技巧不过挺实用,希望对大家的
Delphi
编程有所帮助。以下是实现一次删除多条记录的相关代码供参考: if
DB
Grid
1.SelectedRows.Count >1 then s:= '真的要删除这些记录吗?'; if Application.MessageBox (Pchar(s),'删除多条记录',mb_iconinformation mb_yesNo)=idYes then begin
DB
Grid
1.
DataSource
.
DataSet
.DisableControls ; i:=0; While i<=
DB
Grid
1.SelectedRows.Count -1 do begin
DB
Grid
1.
DataSource
.
DataSet
.Bookmark:=
DB
Grid
1.SelectedRows.Items[i]; //重要在这里取得bookmark TempBookmark :=
DB
Grid
1.
Datasource
.
Dataset
.GetBookmark;
DB
Grid
1.
DataSource
.
DataSet
.GotoBookmark(TempBookMark);
DB
Grid
1.
DataSource
.
DataSet
.Delete ;
DB
Grid
1.
DataSource
.
DataSet
.FreeBookmark (TempBookMark); Inc(i); end;
DB
Grid
1.
DataSource
.
DataSet
.EnableControls; end; 更多代码请您在本页面下载源码。
Delphi
读入数据到
DB
Grid
并向Word中插入表格.rar
Delphi
7.0读入数据到
DB
Grid
并向Word中插入表格,其实就是
Delphi
向Word中插入表格,测试数据由
Delphi
从SQLSERVER中读取,然后放入
DB
Grid
中,再将
DB
Grid
网格中的数据通过Word转换成表格。 begin if TString
Grid
(
DB
Grid
1).RowCount>0 then begin //创建一个word对象 wordApp:=CreateOleObject('Word.Application'); wordApp.Visible:=true; //创建一个word文档 wordDoc:=wordApp.Documents.Add(); wordDoc.Select; wrdSelection:=wordApp.selection; //创建一个表格 wordDoc.Tables.Add(wrdSelection.Range,ADOQuery1.RecordCount 1,
DB
Grid
1.FieldCount,2,0); for i:=1 to
DB
Grid
1.FieldCount do //设置首行的字体为粗体 begin wordDoc.Tables.Item(1).Cell(1,i).Range.Bold:=true; wordDoc.Tables.Item(1).Cell(1,i).Range.InsertAfter(
DB
Grid
1.Columns[i-1].Field.FieldName); end;
DB
Grid
1.
DataSource
.
DataSet
.First; //当前行为首行 for y:=2 to ADOQuery1.RecordCount 1 do //向表中添加数据 begin for i:=1 to
DB
Grid
1.FieldCount do wordDoc.Tables.Item(1).Cell(y,i).Range.InsertAfter(
Db
Grid
1.Fields[i-1].NewValue);
DB
Grid
1.
DataSource
.
DataSet
.Next; //下一行 end; end else showmessage('T
DB
Grid
表中无数据,不能向Word中插入表格。') end;
Spark的灵魂:RDD和
DataSet
本课重点讲解Spark 的灵魂RDD 和
DataSet
。讲解RDD 的定义、五大特性剖析及
DataSet
的定义和内部机制剖析;对RDD 弹性特性七个方面进行解析;讲解RDD 依赖关系,包括窄依赖、宽依赖; 解析Spark 中DAG 逻辑视图;对RDD...
最新Ehlib 5.0.13(含完整
Delphi
、C++builder源代码,完全支持
delphi
2010正式版)
Ehlib 是著名的数据库连接控制,版本为5.0.13,
DB
grid
增强VCL控件;支持多表头,多固定列,按表头排序,支持合计列,并支持直接打印。可以和PB的ataWindow媲美。 本版本含完整源代码,支持以下 IDE:
Delphi
5,6,7,2005 C++Builder 5,6 BDS 2006 (
Delphi
2006, C++Builder 2006)
Delphi
2007 RAD Studio 2009 (
Delphi
2009, C++Builder 2009) Embarcadero RAD Studio 2010 (
Delphi
2010, C++Builder 2010) 本人已在
Delphi
2010中运行通过,在本人编制的进销存软件中应用完全正常。 注:
Delphi
2010里面安装不要修改bpl文件的输出路径,采用默认值,否则安装难以成功。 Version 5.0的改进: + At design-time
grid
can show such components as
DataSource
,
DataSet
, DataDriver in its the bottom left part. These components can be selected in object inspector by mouse clicking. It allows to find quickly and select components which is connected to the
grid
. + New mode - RowPanel. In this mode
grid
allows to show out cells of record one under another and change height of every cell separately. +
Grid
can have special panel of detail information for record. It is allowed to put any control from component palette on this panel. At run time, panel is hidden and user can open it by pressing on a '+' sign which is shown at the begining of every row. +
Grid
can scroll data smoothly and by small steps of one pixel size.
Grid
can scroll data smoothly vertically and horizontally. + Hot track.
Grid
can highlight a cell or a row under mouse cursor. +
Grid
can show vertical line in gradient mode between data rows and bottom part of the
grid
. + In mode Column.AlwaysShowEditButton
grid
shows EditButtons in shadow mode. It doesn't irritate eyes by big amount of edit buttons in the
grid
. + New property EditButtonsShowOptions is added in the
Grid
of type TEditButtonsShowOptionsEh. TEditButtonsShowOptionsEh = set of (sebShowOnlyForCurCellEh, sebShowOnlyForCurRowEh, sebShowOnlyWhen
Grid
ActiveEh, sebShowOnlyWhenDataEditingEh); When Column.AlwaysShowEditButton is True, this property allows to customize, in which cases it is need to show EditButtons. : See detail information
MySQL-demo(
DELPHI
)_mysql示例_
连接好sqlQuery1-sqlconnection至数据库后;利用
dataset
Provider1设置属性
dataset
为sqlQuery1利用Client
dataset
1,设置属性ProviderName为
Dataset
Provider1利用
Datasource
1,设置属性
Dataset
为Client
Dataset
1;利用
DB
Grid
,设置属性
Datasource
为
Datasource
1;即可。
数据库相关
2,497
社区成员
88,445
社区内容
发帖
与我相关
我的任务
数据库相关
Delphi 数据库相关
复制链接
扫一扫
分享
社区描述
Delphi 数据库相关
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章