SQL::ResultSet::ToTableInfo()

Syntax

<Data> as SQL::TableInfo = <SQL::ResultSet>.ToTableInfo()

Argument

Description

<Data>

A SQL::TableInfo object with information about a result set.

<SQL::ResultSet>

A SQL::ResultSet object created with a DIM statement.

Description

The ToTableInfo() method copies the column definitions of the SQL::ResultSet into an unnamed SQL::TableInfo and returns it. This is used to manipulate properties of columns which are then used to create a local table using the DBFRowSyntax property.

Example

dim conn as SQL::Connection

dim rs as SQL::ResultSet

dim connString as C

dim select_exp as C

dim ti as SQL::TableInfo

connString = "{A5API='Access', FileName='c:\program files\a5v8\mdbfiles\alphasports.mdb'}"

select_exp = "select * from customer where bill_state_region = 'ny'"

if .not. conn.open(connString)

    ui_msg_box("Error", conn.CallResult.text)

    end

end if

if .not. conn.execute(select_exp)

    ui_msg_box("Error", conn.CallResult.text)

    conn.close()

    end

end if

rs = conn.ResultSet

ti = rs.ToTableInfo()

ui_msg_box("Results", ti.xml)

conn.close()

The script above produces an XML file similar to the following.

<SQLTableInfo>

    <Owner></Owner>

    <Name></Name>

    <Comment></Comment>

    <NativeAPI></NativeAPI>

    <NativeSyntax></NativeSyntax>

    <LastKnownRowCount>-1</LastKnownRowCount>

    <Updateable>1</Updateable>

    <CanUpdateInTransaction>1</CanUpdateInTransaction>

    <SelectRowLimit>-1</SelectRowLimit>

    <SizeToFit>0</SizeToFit>

    <TableType>Invalid</TableType>

    <Alias></Alias>

    <SQLDataTypeInfo>

        <Name>Firstname</Name>

        <Comment></Comment>

        <NativeAPI></NativeAPI>

        <NativeSyntax></NativeSyntax>

        <AlphaType>67</AlphaType>

        <NativeType>0</NativeType>

        <NativeTypeName></NativeTypeName>

...

See Also

SQL::ResultSet Object

Supported By

Alpha Five Version 8 Enterprise Edition

Limitations

Desktop applications only.