Data types

<< Click to Display Table of Contents >>

Navigation:  Getting Started >

Data types

Previous pageReturn to chapter overviewNext page


Some of the Data Types that are available in Ado/Visual Basic are not available in Visual Objects. We have tried to overcome this by adding a few classes to Xs2Ado and special syntaxes to Xs2Ado.


Data type

X# equivalent


AdoDateTime or DATE


NIL or #Null


NIL or #empty






Decimal or Float (depending on the setting of AdoDecimalAsFloat())







DateTime values can be returned from some of the access of Ado objects, such as the DateModified access on the AdoTable class. It can also be returned as the value of a field of the data type AdDate or similar. In Ado this is represented in a DateTime value, but X# doesn't have such a datatype.Xs2Ado can return these values in an object of AdoDateTime or in a Date value. The format is determined by the setting of the AdoDateTimeAsDate() function. By default this setting is false, and AdoDateTime values are returned. When you set AdoDateTimeAsDate() to TRUE DateTime values are returned as X# Date values, without the time part of the value.


Null values

Columns containing NULL values will return a NIL value by default. You can also set a column to NULL by assiging a NIL to the column. As an alternative for the NIL value you may also use the #Null symbol.

When you are using the AdoServer class (or one of its subclasses) you can use the NullAsBlank property to force Xs2Ado to return blank values of the proper datatype in stead of NIL values .


Empty values

When you are skipping an array element in Ado/VB the contents of this element is filled with as so-called Empty value. When reading this kind of array elements the X# translation will be NIL. When writing an array (like in the aRestrictions array of the AdoConnection:OpenSchema method) you can store the #Empty symbol in the array. This will be replaced with the Ado/VB Empty value by Xs2Ado. All NIL values in arrays will be replaced with Empty by Xs2Ado as well.


Chapter columns

So called 'shaped recordsets' return a sub-recordset in the so-called chapter columns. These sub-recordsets are regular AdoRecordSets.

When you are reading Chapter columns at the AdoRecordSet level you will receive an object of AdoObject. You must convert this to an AdoRecordSet yourself by creating an AdoRecordSet object and by passing the AdoObject as an argument to the AdoRecordSet class.

When you are using the AdoServer class to read chapter columns this translation from an AdoObject into an AdoRecordSet object is done automatically by the AdoServer:FieldGet() method.

When you are using the AdoShapeServer class the AdoRecordSet returned by the AdoServer:FieldGet() is returned as an AdoShapeServer object by the SetRelation method.


See Also  

AdoDateTime, AdoDateTimeAsDate(), AdoServer:NullAsBlank, AdoRecordSet, AdoServer, AdoServer:FieldGet(), AdoServer:FieldPut(), AdoShapeServer, AdoShapeServer:SetRelation(),