Desiderata software® and consultancy blog
specialising in clinical database solutions for Australian hospitals
specialising in clinical database solutions for Australian hospitals
Mar 11th
There is a little trick to connecting to a password protected .xls Excel spreadsheet using the Jet 4.0 OLEDB driver.
If one uses the obvious Password=xxx;User Id=Admin you will get an error “Workgroup Information file missing or file is in use by another user”.
The ADOConnection will return an active connection is using the following connection string but in Delphi 2007 I am still getting an error on trying to read the file “Could not decrypt file”.
So here is the Connection String which will open the connection successfully in Read Only mode:
Provider:=Microsoft.Jet.OLEDB.4.0;Data Source=C:\temp\MyExcel.xls;Mode=Read;Extended Properties=Excel 8.0;Jet OLEDB:Database Password="xxx";
It appears that “Could not decrypt file” error is due to a well known limitation of the Jet OLEDB 4.0 engine in that it always returns this error on trying to read a password protected Excel file even if passwords are known.
The hack around this is to open the file in Excel first in full read/write mode BEFORE opening the TADOConnection – just opening it in READ ONLY mode in Excel WILL NOT work!
This is not only an issue in Delphi but in any application that uses Jet 4.0 OLEDB engine.
Of course, another solution is to use COM OLE automation such as:
If you are dealing with .xlsx Excel 2007 or later files, you cannot use the Jet engine, but you can use the ACE OLEDB driver:
Provider := Microsoft.ACE.OLEDB.12.0;Data Source="C:\temp\MyExcel.xlsx";Extended Properties="Excel 12.0 Xml;HDR=YES;“;Jet OLEDB:Database Password=”";Provider := Microsoft.ACE.OLEDB.14.0;Data Source="C:\temp\MyExcel.xlsx";Extended Properties="Excel 12.0 Xml;HDR=YES;“;Jet OLEDB:Database Password=”";Aug 30th
Embarcadero’s RAD Studio XE2 allows the following database development pathways:
Delphi Object Pascal or C++ generated DataSnap middle tier data servers which run on a Windows server and allows the following thin clients to connect to it:
Third party REMObjects is extending its Hydra technology to allow FireMonkey plugins to work on VCL Winforms, and vice versa, as well as WPF plugins to work in FireMonkey apps and vice versa – see here.
RADPhP web database application using MySQL database.
Aug 4th
Delphi developers are in for a big surprise as the World Tour of RAD Studio XE2 brings them some very unexpected opportunities as well as the expected Win64 compiler.
Here are a few of the new features in XE2:
Very exciting times indeed!!
You can register for the Australian part of the World Tour demonstrations here – the Melbourne event is next Thursday, the 11th August 2011.
Jun 3rd
Skype was written in Delphi which made it easy to download to users with any Windows machine without having to worry about users having to download MB’s of java or .NET support files.
This ease of configuration from the net was one of the reasons that made Skype so popular.
It will be interesting to see what Microsoft does with it now that Google is also entering into the VOIP marketplace with its Google Voice product which uses SIP addresses (SIP technology is now in some of the new mobile phones) – Google Voice is currently only available in the US.
Jun 3rd
Following my last post on Microsoft’s announcement that HTML5and javascript is now their preferred cross-platform development technology and apparently leaving .NET and Silverlight for only Windows and Mac development, Microsoft unveiled Windows 8 this week and seems to be pushing for HTML5 apps as their main apps, with no mention of .NET or Silverlight.
Mar 7th
In the 1990′s, C/C++ and Java ruled the enterprise application world while Microsoft’s Visual Basic was a very limited Windows application tool, and we had Borland’s Delphi with its far more powerful architecture providing one of the best native Windows Rapid Application Development (RAD) tools.
Sun took Microsoft to court when Microsoft tried to add proprietary extensions to Java which was owned by Sun and this ended Microsoft’s desire to use Java.
Microsoft then hired one of the architects of Delphi to come up with its own equivalent of Java – and this was the C# language which became the basis of Microsoft’s .NET technology and Windows Performance Framework (WPF) which was the .NET graphical engine for rendering user interfaces on Windows operating systems.
Microsoft then disgarded its Winforms-based development tools such as MS Visual Basic and forced VB users to migrate to VB.NET which would work alongside C# as a programming tool in the MS Visual Studio suite.
This change of direction pushed most developers to .NET, and away from native compiled Windows applications and also away from Java.
Borland responded by creating a .NET version of Delphi which has now evolved to be Delphi Prism but in the process meant it lost its way, and eventually sold Delphi to Embarcadero which is now again leveraging its power and versatility, particularly with its re-vitalised Win32 native application development which will hopefully soon also be able to create native compiled Win64, Linux and MacOS apps, but also with its relationships with RemObjects and the furthered development of Delphi Prism .NET to include ports to MacOS.
In the first decade of this millenium, the vast majority of Windows application development was targeting .NET and if you were not making .NET, companies would think twice about your product.
In 2007, Microsoft released Silverlight – a C#, .NET, WPF technology designed to compete with Adobe Flash and provide a graphical plugin environment for web browser which would run on other major operating systems including MacOS. Developers again rushed to embrace this new technology which has a lot of nice features but also a few downsides.
In late 2010, Microsoft created an uproar amongst the developer community by its apparent lack of ongoing commitment to Silverlight which although provides the richest client experience on Windows browsers, does not run on the multitude of new devices such as Android. Microsoft and Apple now seem to have abandoned .NET and Silverlight and are pursuing HTML5 and javascript technology as the future of cross-platform web browser applications. Adobe have created their Wallaby conversion tool to allow Flash developers an easier way to migrate their work to HTML5 given that Flash developed websites are locked out of the Apple iOS devices.
see:
This leaves many developers wondering about the future of .NET itself when Microsoft does not actually create any major Windows applications using .NET but rather uses native compiled applications for their better performance.
For instance even though Microsoft totally revamped Office apps in 2007, they did not resort to using .NET to architect these.
Likewise, Microsoft Office is not architected with .NET and has a much better user interface than the browser webmail version which demonstrates the limitations of browser-based rich client application development.
If you follow the arguments currently flying around the web, Silverlight and .NET are just not fast enough for major enterprise-wide rich client major applications, and Winforms is still the preferred technology base for such applications.
I know where this leaves me, very happy that I did not change to .NET and abandon Delphi Win32 and its fast natively compiled Windows applications with full access to Windows API’s and memory management, with potential to have native Win64, MacOS compiled apps in the near future.
Furthermore, HTML5 web client solutions need data driven web servers, and these can be created in Delphi 32, Delphi 64, Delphi Prism .NET or Delphi PHP or C++ Builder, depending on your fancy, either with REST/JSON, SOAP/XML, REMObjects or other messaging and with either Azure, Amazon EC2 cloud, DBExpress, ADO, ADO.NET or ASP.NET data technologies, and all with the same RAD Studio programming tool.
Feb 18th
Two major dilemmas arise with database application development:
How to manage the different SQL dialects:
How to swap between different database engines:
Jan 31st
The Borland Database Engine (BDE) and Delphi versions prior to Delphi 2009 were created before 64 bit Windows 7 and thus the default installations need some tweaking to get them to run.
I have created a page explaining the issues and the tweaks needed to get these running nicely in 64 bit Windows 7 – see here.
Most of the issues have to do with UAC and the altered location of System32 files and registry keys.
Before you install any of these, make sure the least you do is change the default install directory of Delphi to somewhere other than C:\Program Files path!
If you are just wanting to run your Delphi 6 or 7 apps on 32 bit Windows Vista or Windows 7, you just need to be aware of a few issues:
Dec 21st
Many Australian companies use RedCoal SMS texting services to send SMS texts to mobile phones from computers.
RedCoal supplies an API for its MIDA technology with VB and C++ examples but no Delphi code.
I have created a Delphi demo with code using Delphi 2007, which you can download and use free of charge.
Of course, to actually use the SMS text service, you will need to download the SDK from RedCoal which includes a serial number generator which provides the serial number for your application, and you will need to email them for a trial SMS Key (developer’s trial lasts 1 month then there is a one off royalty free developer’s license of $A695).
Finally, your client will need to open an SMS text service account with RedCoal to pay for the actual SMS texts sent (17-22c per SMS for pre-paid).
Post script:
If you deploy this in an organisation which uses a proxy server for internet, then you will need to detect this and set the HTTPWebNode.proxy property which must be in the format server:port (fortunately, this is the format used in Windows registry as outlined below):
for example:
RedCoalRIO.HTTPWebNode.Proxy := GetInternetProxy;
function GetInternetProxy:String;
var reg:TRegistry;
begin
result := ”;
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey(‘\Software\Microsoft\Windows\CurrentVersion\Internet Settings’,False) then
if Reg.readBool(‘ProxyEnable’) then
begin
Reg.CloseKey;
if Reg.OpenKey(‘\Software\Microsoft\Windows\CurrentVersion\Internet Settings’,False) then
Result := Reg.readString(‘ProxyServer’);
end;
finally
Reg.CloseKey;
Reg.Free;
end;
end;
Recent Comments