was my dbExpress driver a wasted purhcase?

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
corneliusd
Posts: 24
Joined: Thu 21 Dec 2006 08:45
Location: Portland, OR
Contact:

was my dbExpress driver a wasted purhcase?

Post by corneliusd » Tue 09 Jan 2007 21:50

I posted a question a couple weeks back, but it looks like my situation is very isolated. This seems rather peculiar to me and I'm quite dismayed to realize I may have to totally rewrite all database access in my application if I want to move from Delphi 2005 to Delphi 2006.

Using dbExpress in Delphi 2005, I converted a VCL application to VCL.NET. Everything worked fine, but later wanted to upgrade to Delphi 2006. I upgraded to the pro version of D2006, which does not come with dbExpress driver for SQL Server. So I came here and everything looked good, so I got the driver.

However, it looks like dbExpress is not supported by Delphi 2006 in VCL.NET. At least not the TSQLQuery component or the TSQLConnection component. Those two components have TWideStrings properties, TSQLQuery.SQL and TSQLConnection.Params. I'd gladly switch out all the TSQLQuery ones for TSQLDataSet (which does not use TWideStrings), but I'd still be left with the connection component.

Is there ANY way around the WideStrings problem in VCL.NET in Delphi 2006? Does no one else use VCL.NET in Delphi 2006? :cry:

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Fri 12 Jan 2007 11:39

You are right, this is known problem.
Unfortunately we can't suggest any workaround in our dbExpress drivers.
We recommend you to assign value of the SQL property (and other properties) in run time but not in design time (do not use definitions of these properties in dfm).
There are some tools that allow you to convert a dfm definition to pascal code, for example GExperts (http://www.gexperts.org/).

corneliusd
Posts: 24
Joined: Thu 21 Dec 2006 08:45
Location: Portland, OR
Contact:

Post by corneliusd » Sat 13 Jan 2007 00:07

Thank you very much for your responses. So you're saying that by creating the components in code it will work, but at design-time, it won't? What gets linked in at compile time that is different? Or is it just a bug in the IDE that puts the wrong unit in there?

I have no problem switching these to code, I just figured there was no .NET equivalent of the WideStrings type--at least not named the same. I thought about creating my own WideStrings unit to replace the one from the Win32 library, but the code looked pretty thick and I didn't want to go there.

I will try converting these over and if it works, I will be EXTREMELY happy!

Thanks again for your response--you're the first I've seen on this issue!

corneliusd
Posts: 24
Joined: Thu 21 Dec 2006 08:45
Location: Portland, OR
Contact:

no--it wasn't wasted!

Post by corneliusd » Mon 15 Jan 2007 16:22

Thank you again so much for your response. It worked very well!

I guess this unearths a bug in the Delphi 2006 IDE where it thinks you need the WideStrings unit, but you don't. It must be supported by .NET wrapper libraries.

Anyway, thanks again--you have been the only one to respond with the solution. It is much appreciated! :D

Post Reply