Version 2.0.2 of ADOmate has been updated to run faster... much faster in fact!
The general sluggishness of the previous versions of ADOmate was made apparent when I issued a query to retrieve 25000 records from a MS Access database! The damn thing just about ground to a halt!
Version 2.0.2 has been streamlined with the biggest change being the fact that ADOmate now uses, where appropriate, prepared COMatePLUS statements. This has made a huge difference. I should have done this earlier, but of course the original version of ADOmate was created before I added statements to COMate and, I kind of overlooked ADOmate!
You can also disable all error reporting from the record retrieval functions (for even more speed) by declaring the constant #ADOmate_NOERRORREPORTINGDURINGRECORDRETRIEVAL = 1 before including the ADOmate source etc.
ADOmate 2.0.2 now requires COMatePLUS and will not run with earlier versions of COMate.
===========================================
Update - 6th Aug 2010.
Version 2.0.1 of ADOmate alters one function and adds another.
ADOmate_ListDatabaseTablesFromConnectionString()
This function takes an ADO connection string and attempts to open the connection and list all of the tables in the underlying database/datasource. Suitable if you do not already hold a connection to the underlying database and just wish to query the tables.
ADOmate_ListDatabaseTables()
This function takes an existing connection and will attempt to list all of the tables in the underlying database/datasource.
The important thing to note is that the second of these functions, ADOmate_ListDatabaseTables(), will not open a separate connection to the database, it will use the existing one.
In terms of existing ADOmate applications, any application which previously called the original ADOmate_ListDatabaseTables() function, will now need to use ADOmate_ListDatabaseTablesFromConnectionString() instead because the original ADOmate_ListDatabaseTables() function has simply been renamed! I have done this for my own convenience.
Please see the updated user manual and the 'listing tables' demo for more details.
===========================================
Update - 31st Jan 2010.
Version 2.0.0 of ADOmate adds support for BLOBs and is to be considered as a test version at the moment.
Support for BLOBs in ADO is a little ‘mixed’ and perhaps the best way of storing such data within our databases involves the use of ADO stream objects alongside updateable recordset objects; something which, whilst relatively straightforward, is not really in keeping with the Purebasic database library and hence is not an approach which I have taken here with ADOmate. Developers are of course free to take this approach. Kiffi posted some code (using COMate) for doing just that in the following forum thread : http://www.purebasic.fr/english/viewtop ... 13&t=40857
Instead, and in keeping with Purebasic's database library, ADOmate attempts to allow the developer to bind BLOB data to ‘parameters’ for use with ADOmate_DatabaseUpdate(). The problem is, however, that ADO doesn’t really allow us to bind parameters in quite the same way as we can with ODBC or SQLite etc. Different providers will either recognise references to our parameters in our SQL statements or they will not. Those that do will invariably use their own syntax for referencing such parameters. Those that do not allow references to bound parameters within SQL statements will instead require us to work with blobs via the ADO stream objects mentioned above.
For example, the OLE-DB Jet provider (MS Access files) allows us to reference our parameters with the following kind of syntax in our SQL :
Code: Select all
SQL$ = "Insert Into Pictures (Pic1, Pic2) Values (?, ?);"
Other providers, if supporting the use of parameters in SQL statements at all, will invariably use a different kind of syntax for referencing the parameters.
Because of this I am classing this version of ADOmate as a test version. It works fine with the OLE-DB Jet provider with MS Access mdb database files, but even here we have a couple of things to note (as you will see in the ADOmate user manual). I will need to await reports of whether this mechanism can be found (or made) to work with other providers; e.g. SQL server and the like, but at least it works with Jet!
New functions added :
Code: Select all
ADOmate_DatabaseColumnSize()
ADOmate_GetDatabaseBlob()
ADOmate_GetDatabaseBlobByFieldName()
ADOmate_GetDatabaseVariant()
ADOmate_GetDatabaseVariantByFieldName()
ADOmate_SetDatabaseBlob
Code: Select all
ADOmate_DatabaseUpdate
===========================================
Update - 12th Nov 2008.
Added functions to retrieve data by field name to supplement those which retrieve data by column index etc.
Code: Select all
ADOmate_GetDatabaseDoubleByFieldName(*connection, fieldName$)
ADOmate_GetDatabaseFloatByFieldName(*connection, fieldName$)
ADOmate_GetDatabaseLongByFieldName(*connection, fieldName$)
ADOmate_GetDatabaseQuadByFieldName(*connection, fieldName$)
ADOmate_GetDatabaseStringByFieldName(*connection, fieldName$)
Hi,
here is a simple source code wrapper for using OLE-DB datasources via Microsoft's ADO (ActiveX Data Objects) library.
ADOmate follows the Purebasic database library almost identically in the way that we define and execute queries and access the resulting recordsets etc. It is thus very easy to use. There are a couple of differences which have been forced upon me, but these are described in the accompanying user guide.
This ease of use does come at the cost of a little flexibility, however, in that some of the more advanced features of ADO are not supported directly by ADOmate. However, since ADOmate relies heavily upon my COMate library, it is consequently very very easy to use COMate to access some of ADO's more advanced features etc. Still, for most everyday uses this will not be required.
Basic feature set :
- errors are reported on a thread-by-thread basis; meaning that multiple threads record their errors separately etc. (much like COMate does)
- unicode support
- create an empty database
- many functions have counterparts within Purebasic's database library
- full support for the different 'cursor types' (no knowledge of this is required however!)
The ADOmate package includes all source files (other than COMate), some demo programs and a rather hastily thrown together user guide! There is also Kiffi's "adoconstants.pbi" file included within the download which is required by ADOmate (although only a small part of this file is used). My thanks to Kiffi for this.
See the nxSoftware site for the download link.
Enjoy.