Re: OpenSchema - is this possible?



Thanks Mike,

You have given me many a helpful hint and I truly appreciate it.

Regards,

Mac


"Mike Shkolnik" <mshkolnik2002@xxxxxxx> wrote in message
news:446e0fc6@xxxxxxxxxxxxxxxxxxxxxxxxx
Use the next function:

function GetFieldTypeName(AType: Integer): string;
begin
case AType of
$00000000: Result := 'adEmpty';
$00000010: Result := 'adTinyInt';
$00000002: Result := 'adSmallInt';
$00000003: Result := 'adInteger';
$00000014: Result := 'adBigInt';
$00000011: Result := 'adUnsignedTinyInt';
$00000012: Result := 'adUnsignedSmallInt';
$00000013: Result := 'adUnsignedInt';
$00000015: Result := 'adUnsignedBigInt';
$00000004: Result := 'adSingle';
$00000005: Result := 'adDouble';
$00000006: Result := 'adCurrency';
$0000000E: Result := 'adDecimal';
$00000083: Result := 'adNumeric';
$0000000B: Result := 'adBoolean';
$0000000A: Result := 'adError';
$00000084: Result := 'adUserDefined';
$0000000C: Result := 'adVariant';
$00000009: Result := 'adIDispatch';
$0000000D: Result := 'adIUnknown';
$00000048: Result := 'adGUID';
$00000007: Result := 'adDate';
$00000085: Result := 'adDBDate';
$00000086: Result := 'adDBTime';
$00000087: Result := 'adDBTimeStamp';
$00000008: Result := 'adBSTR';
$00000081: Result := 'adChar';
$000000C8: Result := 'adVarChar';
$000000C9: Result := 'adLongVarChar';
$00000082: Result := 'adWChar';
$000000CA: Result := 'adVarWChar';
$000000CB: Result := 'adLongVarWChar';
$00000080: Result := 'adBinary';
$000000CC: Result := 'adVarBinary';
$000000CD: Result := 'adLongVarBinary';
$00000088: Result := 'adChapter';
$00000040: Result := 'adFileTime';
$00000089: Result := 'adDBFileTime';
$0000008A: Result := 'adPropVariant';
$0000008B: Result := 'adVarNumeric';
else
Result := '<Unknown>';
end;
end;

--
With best regards, Mike Shkolnik
E-mail: mshkolnik@xxxxxxxxxxxxx
WEB: http://www.scalabium.com

"Mac Davis" <newsgroups@xxxxxxxxxxxxxx> wrote in message
news:446df57a$1@xxxxxxxxxxxxxxxxxxxxxxxxx
I am using OpenSchema to populate a dataset with the following statement

dm.conn.openschema (siColumns, EmptyParam, EmptyParam,dm.adoDataset1);

This works fine except that it returns DATA_TYPE as a numeric value.

First question. Is there a list somewhere of these datatypes and their
corresponding integer value?

Second question. Since a numeric result for the datatype makes no sense,
I
want to create a calculated field to return the same text as Enterprise
manager does. Is it possible to use a calculated field in this case and
display a string for the datatype?

I say

dm.adodataset1.fielddefs.add ('DTYPE', ftString, 12, FALSE);
dm.adodataset1.fieldbyname ('DTYPE').calcuated := TRUE;

dm.adodataset1.asutcalcfields is set to true.

However, I then receive a runtime error ADODataSet1: Field 'Dtype' not
found.

Thanks,

Regards,

Mac






.



Relevant Pages

  • OpenSchema - is this possible?
    ... dm.conn.openschema (siColumns, EmptyParam, EmptyParam,dm.adoDataset1); ... First question. ... Since a numeric result for the datatype makes no sense, ... want to create a calculated field to return the same text as Enterprise ...
    (borland.public.delphi.database.ado)
  • Re: OpenSchema - is this possible?
    ... function GetFieldTypeName: string; ... First question. ... Since a numeric result for the datatype makes no sense, ... Is it possible to use a calculated field in this case and ...
    (borland.public.delphi.database.ado)
  • Help!! Oracle 9.2.0.5.0 wont properly read the *.rsp
    ... #Datatype: String ... #Datatype: Boolean ... #This page shows the current status in the installation. ...
    (comp.databases.oracle.server)
  • Re: GOSUB, the larger picture (was Worldwide known Excellence of GOSUB)
    ... > does not mean that was not a hack. ... Yep, a Byte datatype was indeed needed, and welcome! ... No need to break String, ... It aint bigger Karl, ...
    (microsoft.public.vb.general.discussion)
  • Re: Access Query Right Align
    ... Gary - The DataType is text for all fields. ... Dim hFile As Long ... Dim strPath As String ... Dim strTextLine As String ...
    (microsoft.public.access.queries)