SQLite3 COM TypeInfoLevel property
 
TypeInfoLevel read/write property

Sets/gets the level of type info reported by the Execute, VExecute, AExecute and CExecute methods.

Syntax:

object.TypeInfoLevel = value
v = object.TypeInfoLevel

Parameters:

The property is numeric and the may contain the following constants in the current version. 

0 - (default) Type info is returned as type constants
1 or 3 - .Type info is returned as a single string containing semicolon ";" delimited list of type names for each column in the result.
2 or 4 - The type info is returned as a collection of type names.

See Execute results for the detailed description of the type information.

Examples:

Assume we have the following table declaration:

CREATE TABLE T (
  ID INTEGER PRIMARY KEY,
  A NUMERIC,
  B DATE,
  C INTEGER,
  D TEXT(20)
);

and we have  some data in it so that the queries below return some results. Assume the db is an initialized SQLite COM object and the database is opened. Lets use this query:

Set r = db.Execute("SELECT ID,A,B,C,D,A+C AS E FROM T")

Then if we have several rows in the result. Assume RowN contains a valid row index (e.g. smaller then the total number of the returned rows).

If we want to display the values in this row together with their types and row names we can use the following code lines:

If the TypeInfoLevel is set to 1 or 3:

arr = Split(result(RowN).Info,";")
For FieldN = 1 To result(RowN).Count
  %>
  <%= result(RowN).Key(FieldN) %>:<B><%= result(RowN)(FieldN) %></B> [<%= arr(FieldN - 1) %>]<BR>
  <%
Next

If the TypeInfoLevel is set to 2 or 4:

For FieldN = 1 To result(RowN).Count
  %>
  <%= result(RowN).Key(FieldN) %>:<B><%= result(RowN)(FieldN) %></B> [<%= result(RowN).Info(FieldN) %>]<BR>
  <%
Next

In both cases the result will look like this:

ID:3 [INTEGER]
A:6.25 [REAL]
B:38327.5695717593 [REAL]
C:25 [INTEGER]
D:Some text [TEXT]
E:31.25 [REAL]

Remarks:

By default the type constants are returned. They match some of the vbXXXX type constants:
REAL - vbDouble
INTEGER - vbLong
TEXT - vbString
BLOB - (vbArray Or vbByte)
NULL - vbNull

Applies to: SQLite3 COM object

See also: Execute results

Supported on:

Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later

 

newObjects Copyright 2001-2006 newObjects [ ]