关于两个DBF文件的关联

ming 2000-05-30 12:26:00
现有两个DBF数据库,一个主库,一个从库,将他们关联起来,
并且用DBGRID显示出来,但是一移动数据库,开始移动几条还好
但是再接着移动就死机了,不论移动两个DBGRID中的那一个,而且每次
移动的数据量都不一样,请问这是怎么一回事?主库中有5000多条记录,
从库中有30000多条记录。谢谢。
...全文
315 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ming 2000-05-31
  • 打赏
  • 举报
回复
但是我用的是DELPHI4啊
halfone 2000-05-30
  • 打赏
  • 举报
回复
如果能用,给我一点分哟!我太惨了。
halfone 2000-05-30
  • 打赏
  • 举报
回复
下面的东东也许对你有帮助:
Question:
Why are my Master/Detail relationships not showing the correct detail in the data-aware controls when I scroll through the master?

Answer:

This is a known bug in Delphi 5 and will be fixed. It seems to only happen with queries. Using persistent fields will make it worse. Here is a good workaround which was posted on the borland newsgroup. It requires editing and recompiling the file 'dbctrls.pas' which comes with Delphi.

First find the file 'dbctrls.dcu' on your machine. If you did a default install it should be at 'C:\Program Files\Borland\Delphi5\Source\Vcl'. Rename this to something like 'dbctrls_ORIGINAL.dcu' so you can get it back later if you want. Next start a new, blank application and open the file 'C:\Program Files\Borland\Delphi5\Source\Vcl\dbctrls.pas'. Add Dbctrls to the uses clause of the blank project. Find the definition for procedure TFieldDataLink.UpdateField; and change the code to the following. You may want to just comment out the code that is there in order to save it.


procedure TFieldDataLink.UpdateField;
var
TempField : TField;
begin
if Active and (FFieldName <> '') then
begin
if Assigned(FControl) then
TempField := GetFieldProperty(DataSource.DataSet, FControl, FFieldName)
else
TempField := DataSource.DataSet.FieldByName(FFieldName);
if TempField <> FField then
SetField(TempField)
else
begin
FField := NIL;
SetField(TempField);
end;
end
else
SetField(nil);
end;



Finally, save and Build All Projects (Projects menu). If you get an error that 'dbctrls.dcu' cannot be found then you need to go into Tools and Environment Options and Library and add the path C:\Program Files\Borland\Delphi5\Source\Vcl (or whatever your actual path to the Vcl directory is) to the Library Path.

Now you should be able to compile and create a new 'dbctrls.dcu' file, and your data-aware controls should be updating.

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧