升级到Delphi 6 - 兼容性问题之一

升级到Delphi 6

原著:Borland Corporation

翻译:Musicwind®

日期:2001-07-11

声明:

以下文章的内容取自Delphi 6附带的帮助文件。

版权所有Borland Corporation

翻译此稿事先没有得到Borland的批准,鲁莽之处,希望Borland多多原谅。

 

 


总则

Delphi 6中打开Delphi 5 (或更早版本)的工程,Delphi 会自动对其进行升级。以下将要介绍的是新版本中可能会对现有的Delphi工程带来潜在影响的一些改动。

IDE(集成开发环境)特性

       包名称的自动更新

       兼容性问题

想要了解更多其他信息,请参考”Delphi6新特性”这一部分的内容。

 

OverView

When you load a Delphi 5 or earlier project into Delphi 6, it is automatically updated. The following topics describe changes that could potentially impact existing Delphi projects:

IDE issues

Automatic package name updates

Compatibility issues

Refer also to the What’s New for information on additional features that you may want to incorporate into your applications.

 

兼容性问题

以下列出的是可能影响你的Delphi应用程序的几个大的方面:

 

Compatibility issues

Following are general compatibility issues that may affect your Delphi applications:

 

一.             由于VCL体系结构的变化而引起的ProviderClient Dataset 的一些事件的变动

 

TCustomClientDataSet的引入,使得Delphi 5或早期版本中的事件处理机制做些变动。

DBCLIENT.PAS单元中有5种类型的6个事件发生了变化,他们分别是:

 

事件类型                    变化

 


TResolverErrorEvent            影响到provider OnUpDateError 事件。

TBeforeUpdateRecordEvent   影响到provider BeforeUpdateRecord事件。

TAfterUpdateRecordEvent     影响到provider AfterUpdateRecord事件。

TProviderDataEvent             影响到provider OnGetData and OnUpdateData事件。

TReconcileErrorEvent           影响到client dataset OnReconcileError 事件。

 

必须将以上提到的这些事件对应的处理函数(过程)中的TClientDataSet替换为TCustomClientDataSet

 

Provider, client dataset events affected by VCL hierarchy change

The introduction of TCustomClientDataSet requires changes to event handlers in Delphi 5 and earlier code.

Six events in five types are affected by the change to DBCLIENT.PAS. They are:

 

Type       Event                   change

 


TResolverErrorEvent            Affects the provider’s OnUpDateError event.

TBeforeUpdateRecordEvent   Affects the provider’s BeforeUpdateRecord event.

TAfterUpdateRecordEvent     Affects the provider’s AfterUpdateRecord event.

TProviderDataEvent             Affects the provider’s OnGetData and OnUpdateData events.

TReconcileErrorEvent           Affects the client dataset’s OnReconcileError event

 

In event handlers using the events noted above, you must replace TClientDataSet with TCustomClientDataSet.

 

二.             使用默认数据库登录的代码的变动

 

原先,将一个连接组件(比如 TdatabaseTADOConnection,或TDCOMConnection)的LoginPrompt属性设置为True,则会有默认的登录对话框弹出。这一特性已经不再保留除非你在单元引用中增加一个引用DBLogDlg的语句。如果想要应用程序仍然能够弹出默认的登录对话框,务必加上 Use DBLogDlg这么一句,否则便不会有任何提示输入用户名和密码。

 

Code change required for default Database Login dialog

Previously, setting the LoginPrompt property of a connection component (such as TDatabase, TADOConnection, or TDCOMConnection) caused a default login dialog to appear. This is no longer the case unless you add to your uses clause. Applications that depend on the default login dialog must be edited to add DBLogDlg to the uses clause or they will not prompt for user name and password.

 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值