|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
|
2003/7/26 20:47:49 |
标题: |
|
加入我的收藏 |
楼主: |
procedure TForm3.N2Click(Sender: TObject); var t_temp:ttable; begin dmCli.ClientDataSet1.active:=true; t_temp:=ttable.create(self); t_temp.DatabaseName:='c:\'; t_temp.TableName:='db.dbf'; t_temp.FieldDefs.Assign(dmCli.ClientDataSet1.fielddefs); dmCli.ClientDataSet1.IndexDefs.Update; t_temp.IndexDefs.Clear; t_temp.IndexDefs.Assign(dmCli.ClientDataSet1.indexdefs); t_temp.CreateTable; t_temp.Close; end; 以上代码运行报错: invalid index descriptor table does not exist table:c:\db.dbf 请问该如何解决,谢谢.
----------------------------------------------
能够想到,就一定会实现! |
作者: |
bios (阿贡) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2003/8/4 8:32:31 |
1楼: |
dmCli是什么控件啊
invalid index descriptor :说明原表中的索引字段有非法描述 得从dmCli控件对应的原表查一查!个人看法!
----------------------------------------------
|
作者: |
|
2003/8/4 22:56:22 |
2楼: |
dmCli是TDataModule 另外ClientDataSet 对应的是DBDEMOS库下的employee.db表应该没有问题,你说呢?
----------------------------------------------
能够想到,就一定会实现!
|
作者: |
bios (阿贡) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2003/8/5 8:48:55 |
3楼: |
晕,我也试试,你搞定了吗?如果是,可以贴出结果吗?
----------------------------------------------
|
作者: |
|
2003/8/5 21:07:55 |
4楼: |
我就是搞不定啦,这个问题困扰我很久了,希望你能帮我搞定,谢谢!
----------------------------------------------
能够想到,就一定会实现!
|
作者: |
bios (阿贡) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2003/8/6 21:41:48 |
5楼: |
不好意思,最近比较忙,没能帮你研究,惭愧! 看你的程序看不出什么错误啊!
----------------------------------------------
|
作者: |
bios (阿贡) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2003/8/6 22:32:59 |
6楼: |
搞不定啊 兄弟,我怎么运行你的程序,他说:"miss data provider or data package
啊!?
----------------------------------------------
|
作者: |
|
2003/8/7 17:14:20 |
7楼: |
ClientDataSet 的provider属性一定要指定。
----------------------------------------------
能够想到,就一定会实现!
|
作者: |
bios (阿贡) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2003/8/7 17:39:17 |
8楼: |
可不可以把你的工程和库发给我看看 jeamicle@etang.com
----------------------------------------------
|
作者: |
bios (阿贡) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2003/8/7 21:25:10 |
9楼: |
var t_temp:ttable; begin dmCli.ClientDataSet1.active:=true; t_temp:=ttable.create(self); t_temp.DatabaseName:='e:\'; t_temp.TableName:='bios2.db'; t_temp.FieldDefs.Assign(dmCli.ClientDataSet1.fielddefs); dmCli.ClientDataSet1.IndexDefs.Update; t_temp.IndexDefs.Clear; t_temp.IndexDefs.Assign(dmCli.Table1.IndexDefs); //只能这样写,直接Assign 原TABLE1,原数据库必须有索引字段! t_temp.CreateTable; t_temp.Close; end;
----------------------------------------------
|
|