Friday, August 31, 2007

Delphi for PHP Update #2

Delphi for PHP Update 2 is available!
Download it here.

Go get it! It contains fixes, improved documentation! and an updated VCL for PHP.

Wednesday, August 29, 2007

ADODB Promptdatasource in .NET

In Delphi Win32 it is very easy to use the standard Windows OleDB datalink connection dialog to build Connectionstrings at runtime.


It is as simple as this, use ADODB and you have the PromptDataSource function:

ConnString := PromptDataSource(Handle, ConnString);

In .NET however it is a little more complex. To make a function that can do this, you must first add references to both the Microsoft ActiveX Data Objects 2.8 Library (=ADODB namespace) and the Microsoft OLE DB Service Component 1.0 Type Library (=MSDASC namespace). In C# the code looks something like this:

private string PromptDataSource()
{
MSDASC.DataLinks dataLinks = new MSDASC.DataLinksClass();
ADODB.Connection connection = new ADODB.ConnectionClass();
object oConnection = (object)connection;
if (dataLinks.PromptEdit(ref oConnection))
return connection.ConnectionString;
else
return "";
}


In Delphi .NET the code looks like this:

uses ADODB, MSDASC; (Add to your uses clause).

function TForm1.PromptDatasource : string;
var
Datalinks : DataLinksClass;
ADOConnection : Connection;
oConnection : TObject;
begin
Result := '';
Datalinks := DataLinksClass.Create;
ADOConnection := ADODB.ConnectionClass.Create;
oConnection := TObject(ADOConnection);
if Datalinks.PromptEdit(oConnection) then begin
Result := ADOConnection.ConnectionString;
end;
end;



In Delphi .NET it is wise to remove the namespace prefixing.
Default there is a prefix Borland.VCL. If you don't remove that the compiler will use the Borland.VCL.ADODB namespace instead of the ADODB namespace from the COM import.
You can do this in the options dialog under Tools.
(Or alter your project specific namespace prefixes in the project options)

Highlander, can't take that long, can it?

It just can not be taking that much longer (in time) that Highlander (Rad Studio 2007) will hit the doorsteps. There is a lot going on, like the beta blogging, and sheduled RAD 2007 Chats and sheduled RAD Studio 2007 Developer Days.
(Taking place 5, 12, 13 september)

There are some nice beta blogging entry about the new kid on the blog.

Generics:
Bob Swart shows some generics
Hallvard Vassbotn has a very detailed overview of generics and other new language features.

ECO IV:
Peter Morris has a detailed overview of ECO IV
Dave Clegg shows, in this CDN video, ECO IV with VCL.NET
Olaf Monien shows XAML coding using .NET 3.0/WPF.

Blackfish:
John MosHakis has some information about Blackfish SQL

Intresting CodeGear blogposts
Dee Elling talks about the improved help

No, no doubt RAD Studio 2007 is coming! (Real soon now?)

Friday, August 17, 2007

Monday, August 06, 2007

Back online, catching up and the human compiler

After spending three weeks in Italy (Adriano-Ravenna) on the Adriatico coast, touching no computer at all (except my PDA) it is now time to start things up again.

Catching up the Delphi scene

It looks like Delphi update 2 is coming real soon now. (It seems someone slipped some readme file)

Nick Hodges reveals the things that are not on the roadmap, with, of course, the stopped .NET 2.0 Winform designer which I blogged about sometime ago. He talks about why development was stopped, which is understandable from their standpoint of view. Developers who does not use Delphi .NET winforms are, of course, happy about it. However for those that used Delphi .NET for Winforms since Delphi 8 they will have to move away from Delphi for that type of applications. But you know: Sh*t happens, step over it

There is a nice (new?) site called codegearguru.com with a lot of video tutorials. Have not dived into it, but it looks good.

Marco Cantu is working on a Delphi 2007 handbook.

Steve Peacocke has some nice blogposts about the history of Delphi/Pascal.

The human brain is a cool compiler
I tend to read some, not computer related books, on holidays. This year I had some book about the human brain and how it works.
Did you know that the human brain does not have to read all the letters in a word to understand the meaning of the word? Only the first and last character of a word must be in the right place. Let see if this is true, can you read this?

So Ceagoder is cionmg rael soon now wtih udptae 2 of Dlehpi. Is tihs not amnzaig? If tihs cuold be ileemepnmtd in teh coepimlr it wuold gvie lses erorrs on tpoys!

Well OK, back to work!