请教BCB访问MySQL
我用BCB6,dbExpress系列控件访问MySQL数据库,在取得数据进数据集之后,通过数据源控件将数据传给数据库控制组件,别的控件诸如DBText,DBEdit等都没有问题,唯独DBGrid出问题,错误是“Operation not allow on a unidirectional dataset”,但我又想用类似DBGrid的控件,怎么办?请教! 问题点数:0、回复次数:8Top
1 楼xc2927(谁让我爱上你的)回复于 2003-07-03 13:08:32 得分 0
帮你UPTop
2 楼binbin(破坏分子)回复于 2003-07-03 18:40:36 得分 0
有专门的mysql控件,能直接连接mysqlTop
3 楼ThinkX(秋天的树)回复于 2003-07-03 20:02:17 得分 0
在TSQLDataSet上按 F1,
有下面一段
TSQLDataSet is a unidirectional dataset. Unlike other datasets, unidirectional datasets do not buffer multiple records in memory. Because of this, you can only navigate using the First and Next methods. There is no built-in editing support: you can only edit the data in an SQL dataset by explicitly creating an SQL UPDATE command or by connecting the dataset to a client dataset using a provider. Features that require buffering multiple records, such as filters or lookup fields, are not available.
很明白,
DBX的dataset是唯读的只进的,换句话说,
它只能一行一行的next,不能后退,也不能前进更多。
你可以选用其他控件,或者使用其他办法。Top
4 楼Aweay(别问我问题,2年不用忘光了)回复于 2003-07-03 23:06:48 得分 0
dbexpress,是前向,只读的数据访问模型,你需要搭配TClientDataSet组建才能做到双向,写数据。
而TDBGrid是随即访问的,随意是会出错的,所以你需要使用TClientDataSet组建.
----------------------------------
感谢您选用Borland产品,更多信息请前往Borland社区和新闻组查询:.......
Top
5 楼Aweay(别问我问题,2年不用忘光了)回复于 2003-07-03 23:09:12 得分 0
搭配的办法:
使用TProvider连接数据,TClientDataSet连接TProvider,DataSource连接TClientDataSet,TDBGrid连接DataSource
----------------------------------
感谢您选用Borland产品,更多信息请前往Borland社区和新闻组查询:.......
Top
6 楼tinderman(塞外飞鹄)回复于 2003-07-04 08:54:04 得分 0
用MyOdbc吧,去MySQL网站上DownLoad一个。Top
7 楼ThinkX(秋天的树)回复于 2003-07-04 12:57:16 得分 0
用TSQLClientDataSet也可以Top



