Migrating old Delphi 7 code to Delphi XE - do you really need the right code?

I have an old application using BDE under Delphi 7, and now bought Delphi XE. I see that many say that the main problem with code porting is changing to unicode. And maybe a database that supports unicode.

But do I really need to do this? Can I not just stick to BDE and some "good old string format"?

I hope to escape with a quick replacement in Delphi Xe here, not necessarily using all the new features, etc. etc.

Rgds PM

+4
source share
4 answers

The data fields that connect your data to the database have not changed. TStringField still has a Value property of type AnsiString that matches the old behavior.

When you check all the warnings that the compiler spits out, you can leave without much effort and keep BDE alive.

In addition, I suggest replacing BDE with a more recent solution for the foreseeable future - not just because of Unicode.

+6
source

It is very difficult to avoid using the new UnicodeString , to which string is now applied. You can write all your AnsiString code if you want, but why bother? As soon as you use some non-trivial library (e.g. RTL, VCL, third-party), you float against the tide. If you try to continue working with AnsiString , in my opinion, you will make life more difficult for yourself.

If you let it go, you should find that it's not such a big job to move on to a new Unicode string type. The vast majority of existing code will work unchanged.

+5
source

I made the same move from D7 to XE, and this change was a killer. My application, like yours, includes a database - in my case, these are Interbase and Interbase Express components that are part of Delphi. I made the choice to switch to Unicode, but it was ugly.

I read newspapers, but compared to my experience, they seemed incomplete or, perhaps, even incorrect in some cases. I think the documents are written in terms of a Delphi application without a database. I believe that there were critical errors in Interbase Express (Delphi) and Interbase. I think at least one bug has been fixed in IB and a couple in Delphi - if you upgrade to the XE version. (I do not want to consider it again now).

I ended up adding corrections in my code to help Delphi exit. In the newsgroups and in QC, people told me that I did not understand. Well, finally, there are changes that come from these problems, so there really should be problems somewhere.

Conflicting views expressed in this thread indicate confusion with Unicode. On some of these issues, I do not know how this will work, even after going through it. But I have doubts that I can go through it and hold on to BDE. This may have built-in problems that cannot be fixed and that you cannot handle. There are several entries in QC that you can check to see some of the problems.

When my application was in D7, my IB base was ansi. When it was converted to Delpi XE, it seemed to work fine - although it was just a small check. IB supports Unicode, and I converted my data there. Could you do this with your data? Only after that I found problems. I think that any meaningful conversion to Unicode means that you first convert the data warehouse to Unicode, and then to your Delphi application.

So, after all this, why are you switching to XE if you don't want unicode? Is it just an update or is it what you are trying to achieve? I hope this long post helps.

0
source

We also have many applications working with BDE with Delphi-7, and are considering the transition to DelphiXE. The jump is not very pleasant ... if you want your program to work in the 64-bit version of Windows7, you will need to convert BDE or load BDE express or another tool. BDE has problems with memory leaks, so we converted these components, but remain in Delphi-7 for older products and use Delphi XE for new projects. Good luck.

0
source

All Articles