Are you an ADO developer who needs to migrate your knowledge and code from a PC to a Pocket PC? I'll show you the similarities and differences between ADO and ADOCE through some code instances.
This article requires:
· Microsoft? eMbedded Visual Tools.
· Microsoft SQL Server Developer Edition.
· SQL Server Windows? CE Edition.
· Microsoft ADOCE (ActiveX?) Data Objects CE) 3.1 included with SQL Server Windows CE Edition.
· To try the server-side examples, do you need Microsoft Visual Studio? and ADO 2.6.
Gotchas
Because there is a memory leak in the CreateObject declaration, you'd better create only ADOCE objects once in your program. In the instance code, I put the CreateObject call into every event procedure, but that's just to compare the ADO code.
Data access
Most enterprise applications are data-centric, which means you need to know how to store information. My hobby is to store the data when using the real database--sql Server Windows CE Edition on the Pocket PC. So my first recommendation is to get permission from a SQL Server Developer edition that you need.
When you install SQL Server Windows CE Edition, you will also get ADOCE 3.1, the latest version. I'll compare it to the latest version of ADO 2.6 on my PC.
Major differences
OK, let's take a look at the important differences first. The following is a list of ADO features not supported by ADOCE:
· Command and Parameter objects
· Collection objects
· Property Object
· Recordset Persistence (Recordset.save)
· Asynchronous queries
· Disconnected recordsets
· Dynamic Creation of recordsets
· Multiple queries (recordset.nextrecordset)
For me, the absence of a recordset persistence means that I cannot save the result set as Extensible Markup Language (XML) to be invoked by other programs on the Pocket PC. Perhaps more importantly, I can't deposit XML data into my results set. This has caused me to convert the data from the server component to the Pocket PC, or vice versa--and I need some transformation. My advice is to look at what Odyssey Software offers. Their cefusion and ViaXML products are useful here. If you are looking for a longer term (read Microsoft.) NET) to transform the data, you should look at the Pocketsoap.
In any case, most of the important features are implemented in the ADOCE. Now let's take a look at some of the differences in the same data access environment.