After reading this blog posting I thought that there may be more people with the problem that DBX 4 makes it hard to deploy a database application without a DBXDrivers.ini file.
So here is a small unit that I wrote some years ago which allows me to connect to a local MySQL DB without the need of a DBXDivers.ini. (Delphi Professional is not for professionals but for starters. Otherwise the “only allowed to connect to local databases” limitation isn’t explainable. That’s why I mainly use the Zeos components instead of DBX to connect to a database)
If you want to connect to an other database vendor, you have to adjust the string literals in TDBXInternalProperties.Create and the driver name in the RegisterDriverClass(‘MySQL’, ..) call.
unit DBXMySQL; interface implementation uses DBXCommon, DBXDynalinkNative; type TDBXInternalDriver = class(TDBXDynalinkDriverNative) public constructor Create(DriverDef: TDBXDriverDef); override; end; TDBXInternalProperties = class(TDBXProperties) public constructor Create(DBXContext: TDBXContext); override; end; { TDBXInternalDriver } constructor TDBXInternalDriver.Create(DriverDef: TDBXDriverDef); begin inherited Create(DriverDef, TDBXDynalinkDriverLoader); InitDriverProperties(TDBXInternalProperties.Create(DriverDef.FDBXContext)); end; { TDBXInternalProperties } constructor TDBXInternalProperties.Create(DBXContext: TDBXContext); begin inherited Create(DBXContext); Values[TDBXPropertyNames.DriverUnit] := ''; // This is for the IDE only Values[TDBXPropertyNames.GetDriverFunc] := 'getSQLDriverMYSQL'; Values[TDBXPropertyNames.LibraryName] := 'dbxmys.dll'; Values[TDBXPropertyNames.VendorLib] := 'LIBMYSQL.dll'; Values[TDBXPropertyNames.Database] := 'Database Name'; Values[TDBXPropertyNames.UserName] := 'user'; Values[TDBXPropertyNames.Password] := 'password'; Values[TDBXPropertyNames.MaxBlobSize] := '-1'; end; var InternalConnectionFactory: TDBXMemoryConnectionFactory; initialization TDBXDriverRegistry.RegisterDriverClass('MySQL', TDBXInternalDriver); InternalConnectionFactory := TDBXMemoryConnectionFactory.Create; InternalConnectionFactory.Open; TDBXConnectionFactory.SetConnectionFactory(InternalConnectionFactory); end. |
This works interesting!
I think that Delphi Professional is for professionals!
I use Delphi Pro since 1997 and I don´t need to use other versions. Maybe I am only starting with Delphi.
I use third part dbx Drivers and can connect to databases as Client / Server and I don´t need to create 3 thier applications.
Have your read the license_en.rtf file?
Great stuff Andreas – thanks for the suggestion. I shall look into this, tho it will need a bit of further tweaking to suit our needs I think (see my response in the comments on my own blog).
As regards the archaic “no remote databases” access provision in the Professional license…
Yes, it is stupid, dumb, ridiculous, antiquated etc etc. But it always was. Delphi Pro has always had this limitation, even under the days of the BDE>
Borland never woke up to the fact that this simply drove people away from their DB technology to less restricted alternatives (when everyone can just use ADO, for example, putting such limits on alternative technologies does nothing except make them less attractive).
The name over the door has changed, but the people in charge are – as we kept being told as if it were a good thing – so it really should be no surprise that dumb decisions made in the past are not just inherited but propogated by the current management.
+1 for your comments. I agree with you Jolyon
Another INC from me too. The thing is with databases – the end user scenarios are more complex than the Enterprise scenarios. In the meanwhile the whole thing has changed…
For me the picture presented is … who in the world today thinks that the work of a professional is in knowing the technological underlying … on Windows … not of interest. This adds no value in Business Software. It just leaves a bad taste …
Andy,
You have mentioned Zeos in your post. I am just curious to know if you have updated it to work with XE.
I’m using the Zeos Testing branch: svn://zeos.firmos.at/zeos/branches/testing
But the trunk should also do it: svn://zeos.firmos.at/zeos/trunk
Hey Andy,
Sorry for posting this into an unrelated topic, but I couldn’t find any other way to pass on a bug report to you on your site. BTW, thank you for your awesome work, it’s greatly appreciated and this isn’t a whinge or a complaint!
When I use the Find Unit dialog in Delphi 2010 in a project with units with relative paths (specifically, relative paths to a sub directory under the project directory), and I try to use one of those units, an error occurs. Eg:
Where “source” is the folder under the project directory. The standard Delphi Use Unit dialog is then displayed.
I am currently using DDevExtensions version 2.1, although this issue has been present for me for at least the last few versions of the add-in.
Just thought I would pass it on, no reply required, and you can feel free to moderate this post out of this blog entry. 🙂
Thank you again,
N@
Natalie Vincent
I already know about this bug, but I didn’t had the time to reproduce it. And I’m not actively working on DDevExtensions till at least christmas.
Hey Andy,
Thanks for letting me know. 🙂
N@